mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: remove duplicate em highlight
This commit is contained in:
@@ -14,15 +14,13 @@ class Em {
|
||||
_exp,
|
||||
onMatch: (Match match) {
|
||||
String matchStr = match[0]!;
|
||||
var map = {'type': 'em', 'text': regCate(matchStr)};
|
||||
res.add(map);
|
||||
res.add({'type': 'em', 'text': regCate(matchStr)});
|
||||
return matchStr;
|
||||
},
|
||||
onNonMatch: (String str) {
|
||||
if (str != '') {
|
||||
str = parse(str).body?.text ?? str;
|
||||
var map = {'type': 'text', 'text': str};
|
||||
res.add(map);
|
||||
str = decodeHtmlEntities(str);
|
||||
res.add({'type': 'text', 'text': str});
|
||||
}
|
||||
return str;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user