Closed Espero1995 closed 2 years ago
Can you post an example?
Like . -
是因为特殊字符串和其他字符连续的原因嘛?我对特殊字符后面加空格好像就能正常高亮显示了。在已解决的issue里我看到的电话号码99+的是因为后面有个空格,所以才高亮了,但是我去掉空格发现也是没有高亮的
EasyRichText(
"Received 1-1-2 messages. Received 1.1.2 messages.",
patternList: [
EasyRichTextPattern(
targetString: '1-',
matchWordBoundaries: false,
style: const TextStyle(color: Colors.red),
),
],
),
EasyRichText(
"Received 1-1-2 messages. Received 1.1.2 messages.",
patternList: [
EasyRichTextPattern(
targetString: '1.',
hasSpecialCharacters: true,
matchWordBoundaries: false,
style: const TextStyle(color: Colors.red),
),
],
),
要在 1-1-2
连续的字符串中匹配部分字符串1-
,要设置matchWordBoundaries: false,
OK了,非常感谢
I found that after setting hasSpecialCharacters: true, the original matching ordinary characters did not take effect, and the special symbols were not set to the highlighted state.