fix(parser): handle additional Unicode punctuation in tag parsing
This commit is contained in:
parent
64e9d82d67
commit
3989100a27
1 changed files with 3 additions and 3 deletions
|
|
@ -81,17 +81,17 @@ func (*tagParser) Parse(_ gast.Node, block text.Reader, _ parser.Context) gast.N
|
||||||
// U+FF00-U+FFEF - Fullwidth punctuation
|
// U+FF00-U+FFEF - Fullwidth punctuation
|
||||||
if c >= 0x80 && tagEnd+2 < len(line) {
|
if c >= 0x80 && tagEnd+2 < len(line) {
|
||||||
b1, b2, b3 := line[tagEnd], line[tagEnd+1], line[tagEnd+2]
|
b1, b2, b3 := line[tagEnd], line[tagEnd+1], line[tagEnd+2]
|
||||||
|
|
||||||
// U+3000 IDEOGRAPHIC SPACE (E3 80 80)
|
// U+3000 IDEOGRAPHIC SPACE (E3 80 80)
|
||||||
if b1 == 0xE3 && b2 == 0x80 && b3 == 0x80 {
|
if b1 == 0xE3 && b2 == 0x80 && b3 == 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// U+3001-U+303F CJK punctuation (E3 80 81 to E3 80 BF)
|
// U+3001-U+303F CJK punctuation (E3 80 81 to E3 80 BF)
|
||||||
if b1 == 0xE3 && b2 == 0x80 && b3 >= 0x81 && b3 <= 0xBF {
|
if b1 == 0xE3 && b2 == 0x80 && b3 >= 0x81 && b3 <= 0xBF {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common fullwidth punctuation: !?,。;:()
|
// Common fullwidth punctuation: !?,。;:()
|
||||||
// U+FF01 ! (EF BC 81), U+FF1F ? (EF BC 9F)
|
// U+FF01 ! (EF BC 81), U+FF1F ? (EF BC 9F)
|
||||||
// U+FF0C , (EF BC 8C), U+FF0E 。 (EF BC 8E)
|
// U+FF0C , (EF BC 8C), U+FF0E 。 (EF BC 8E)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue