Fix search highlight

This commit is contained in:
2026-06-25 17:54:36 +08:00
parent a75471117f
commit c9225c2b26

View File

@@ -233,10 +233,13 @@ export class HighlightedMarkdown extends Component {
} catch (e) {}
} else {
let search_kws = (
props.search_param.match(/"[^"]*"|[^\s()+:"[\]-]+/g) || []
props.search_param.match(/"[^"]*"|'[^']*'|[^\s()+:"'[\]-]+/g) ||
[]
)
.map((s) =>
s.startsWith('"') ? s.slice(1, -1) : s.split('^')[0],
s.startsWith('"') || s.startsWith("'")
? s.slice(1, -1)
: s.split('^')[0],
)
.filter((s) => s);
if (search_kws.length) {