From 2fde54b3bc766c786c28b5ab0a8d92f9908cfdab Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 1 Jul 2025 00:29:40 -0700 Subject: [PATCH] typegen: fix callout bug which didn't add newlines --- typegen/src/reformat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typegen/src/reformat.rs b/typegen/src/reformat.rs index 4bca75a..70f8d04 100644 --- a/typegen/src/reformat.rs +++ b/typegen/src/reformat.rs @@ -17,13 +17,13 @@ pub struct GfmQuoteBlocks { impl GfmQuoteBlocks { pub fn new() -> Self { Self { - callout_regex: Regex::new(r#">\s+\[!(?\w+)]\s+(?=\w)"#).unwrap() + callout_regex: Regex::new(r#">\s+\[!(?\w+)]\s+"#).unwrap() } } } impl ReformatPass for GfmQuoteBlocks { - fn reformat(&self, _: &Context, text: &mut String) { + fn reformat(&self, _: &Context, text: &mut String) { *text = text.replace("> [!INFO]", "> [!NOTE]"); *text = self.callout_regex.replace_all(text, "> [!$type]\n> ").to_string(); }