Skip to content

Commit 27a6087

Browse files
authored
fix: tag regex no longer includes purely numerical 'tags' (#485)
* fix: tag regex no longer includes purely numerical 'tags' * fix: formatting * fix: use guard in findAndReplace() instead of expanding the regex
1 parent 1bf7e3d commit 27a6087

File tree

1 file changed

+4
-0
lines changed
  • quartz/plugins/transformers

1 file changed

+4
-0
lines changed

quartz/plugins/transformers/ofm.ts

+4
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
400400
return (tree: Root, file) => {
401401
const base = pathToRoot(file.data.slug!)
402402
findAndReplace(tree, tagRegex, (_value: string, tag: string) => {
403+
// Check if the tag only includes numbers
404+
if (/^\d+$/.test(tag)) {
405+
return false
406+
}
403407
tag = slugTag(tag)
404408
if (file.data.frontmatter && !file.data.frontmatter.tags.includes(tag)) {
405409
file.data.frontmatter.tags.push(tag)

0 commit comments

Comments
 (0)