Fix search highlight

This commit is contained in:
2026-06-24 21:37:00 +08:00
parent 4df5acd24c
commit a75471117f

View File

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