Fixed search highlighting for non-latin languages

This commit is contained in:
squidfunk
2017-06-01 00:54:06 +02:00
parent 974f07ccb4
commit d17b0fbb90
4 changed files with 4 additions and 4 deletions

View File

@@ -209,7 +209,7 @@ export default class Result {
/* Assemble highlight regex from query string */
const match = new RegExp(
`\\b(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
`(?:^|\\s)(${escape(this.value_.trim()).replace(" ", "|")})`, "img")
const highlight = string => `<em>${string}</em>`
/* Render results */