mod: 搜索专栏副标题转义
This commit is contained in:
@ -19,16 +19,7 @@ class Em {
|
||||
return regCate(matchStr);
|
||||
}, onNonMatch: (String str) {
|
||||
if (str != '') {
|
||||
str = str
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'")
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'")
|
||||
.replaceAll(' ', " ")
|
||||
.replaceAll('&', "&")
|
||||
.replaceAll(''', "'");
|
||||
str = decodeHtmlEntities(str);
|
||||
Map map = {'type': 'text', 'text': str};
|
||||
res.add(map);
|
||||
}
|
||||
@ -36,4 +27,17 @@ class Em {
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
static String decodeHtmlEntities(String title) {
|
||||
return title
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'")
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'")
|
||||
.replaceAll(' ', " ")
|
||||
.replaceAll('&', "&")
|
||||
.replaceAll(''', "'");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user