Open weii41392 opened 10 months ago
@weii41392 thanks for the report and the fix! This has been released in the latest linkifyjs v4.1.3
@weii41392 thanks for the report and the fix! This has been released in the latest linkifyjs v4.1.3
Thank you @nfrasser! But with further testing we found that the current logic doesn't work as expected. Is this intended or can we also modify this behavior?
http://foo.com/blah_blah
http://foo.com/blah_blah)
http://foo.com/blah_blah(123)
http://foo.com/blah_blah) withWhitespace
)
and withWhitespace
.http://foo.com/blah_blah)withoutWhitespace
)
and withoutWhitespace
.Different from English, we don't add whitespaces in Chinese (at least in formal writing). That's why http://foo.com/blah_blah) withWhitespace
works for English convention but http://foo.com/blah_blah)withoutWhitespace
doesn't work for Chinese.
Currently the parser can recognize opening parentheses and closing parentheses and exclude closing parentheses when appropriate, while we don't have the same behavior with fullwidth characters. See this example:
My proposal is to define fullwidth characters as tokens, and add new behaviors in the parser. The logic should be fairly simple as fullwidth brackets are semantically the same as their halfwidth counterparts. (In our use case we care more about fullwidth parentheses
()
, but in general this can apply to other fullwidth characters, e.g.「」『』<>
.)