Fix search highlight
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user