mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 22:33:42 -04:00
Fixed missing escaping of HTML in search highlighting
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import escapeHTML from "escape-html"
|
||||
|
||||
import { SearchIndexConfig } from "../_"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
@@ -77,7 +79,7 @@ export function setupSearchHighlighter(
|
||||
})`, "img")
|
||||
|
||||
/* Highlight string value */
|
||||
return value => value
|
||||
return value => escapeHTML(value)
|
||||
.replace(match, highlight)
|
||||
.replace(/<\/mark>(\s+)<mark[^>]*>/img, "$1")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user