Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix(parser): handle additional Unicode punctuation in tag parsing

Steven3989100a2769
diff --git a/plugin/markdown/parser/tag.go b/plugin/markdown/parser/tag.go
index 038252159..f176e0048 100644
--- a/plugin/markdown/parser/tag.go
+++ b/plugin/markdown/parser/tag.go
@@ -81,17 +81,17 @@ func (*tagParser) Parse(_ gast.Node, block text.Reader, _ parser.Context) gast.N
// U+FF00-U+FFEF - Fullwidth punctuation
if c >= 0x80 && tagEnd+2 < len(line) {
b1, b2, b3 := line[tagEnd], line[tagEnd+1], line[tagEnd+2]
-
+
// U+3000 IDEOGRAPHIC SPACE (E3 80 80)
if b1 == 0xE3 && b2 == 0x80 && b3 == 0x80 {
break
}
-
+
// U+3001-U+303F CJK punctuation (E3 80 81 to E3 80 BF)
if b1 == 0xE3 && b2 == 0x80 && b3 >= 0x81 && b3 <= 0xBF {
break
}
-
+
// Common fullwidth punctuation: !?,。;:()
// U+FF01 ! (EF BC 81), U+FF1F ? (EF BC 9F)
// U+FF0C , (EF BC 8C), U+FF0E 。 (EF BC 8E)