2
1
Fork 0

typegen: fix callout bug which didn't add newlines

This commit is contained in:
outfoxxed 2025-07-01 00:29:40 -07:00
parent cf3ef03c42
commit 2fde54b3bc
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -17,13 +17,13 @@ pub struct GfmQuoteBlocks {
impl GfmQuoteBlocks {
pub fn new() -> Self {
Self {
callout_regex: Regex::new(r#">\s+\[!(?<type>\w+)]\s+(?=\w)"#).unwrap()
callout_regex: Regex::new(r#">\s+\[!(?<type>\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();
}