The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: change callout metadata regex to include non-letter characters (#1174)

* fix: change callout metadata regex to include non-letter characters

* fix: make metadata regex non-greedy

This allows for users to have callouts such as
> [!NOTE|left foo-bar 123] a ]+ title with square brackets [s] a
> Contents

authored by

Alex Nordstrom and committed by
GitHub
9ff4626d a99e854d

+2 -2
+2 -2
quartz/plugins/transformers/ofm.ts
··· 123 123 const highlightRegex = new RegExp(/==([^=]+)==/, "g") 124 124 const commentRegex = new RegExp(/%%[\s\S]*?%%/, "g") 125 125 // from https://github.com/escwxyz/remark-obsidian-callout/blob/main/src/index.ts 126 - const calloutRegex = new RegExp(/^\[\!(\w+)\|?(\w+)?\]([+-]?)/) 127 - const calloutLineRegex = new RegExp(/^> *\[\!\w+\|?\w*\][+-]?.*$/, "gm") 126 + const calloutRegex = new RegExp(/^\[\!(\w+)\|?(.+?)?\]([+-]?)/) 127 + const calloutLineRegex = new RegExp(/^> *\[\!\w+\|?.*?\][+-]?.*$/, "gm") 128 128 // (?:^| ) -> non-capturing group, tag should start be separated by a space or be the start of the line 129 129 // #(...) -> capturing group, tag itself must start with # 130 130 // (?:[-_\p{L}\d\p{Z}])+ -> non-capturing group, non-empty string of (Unicode-aware) alpha-numeric characters and symbols, hyphens and/or underscores