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) {} } catch (e) {}
} else { } else {
let search_kws = ( let search_kws = (
props.search_param.match(/"[^"]*"|[^\s()+:"[\]-]+/g) || [] props.search_param.match(/"[^"]*"|'[^']*'|[^\s()+:"'[\]-]+/g) ||
[]
) )
.map((s) => .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); .filter((s) => s);
if (search_kws.length) { if (search_kws.length) {