mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-24 23:04:32 -04:00
Fixed error when search term contained parentheses
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import escape from "escape-string-regexp"
|
||||
import lunr from "lunr"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
@@ -184,7 +185,7 @@ export default class Result {
|
||||
|
||||
/* Assemble highlight regex from query string */
|
||||
const match = new RegExp(
|
||||
`\\b(${this.value_.trim().replace(" ", "|")})`, "img")
|
||||
`\\b(${escape(this.value_.trim().replace(" ", "|"))})`, "img")
|
||||
const highlight = string => `<em>${string}</em>`
|
||||
|
||||
/* Render results */
|
||||
|
||||
Reference in New Issue
Block a user