Skip to content

Commit da20016

Browse files
committed
fix <, > in search
1 parent 0af3aa4 commit da20016

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/_static/js/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ function parseLunrResults(results, results_i, text) {
151151
const textIndex2 = lowerCasePreview2.indexOf(lowerCaseText)
152152
if (textIndex2 != -1) {
153153
newpreview = newpreview +
154-
preview_i.slice(0, textIndex2) +
154+
preview_i.slice(0, textIndex2).replace(/</g, "&lt").replace(/>/g, "&gt") +
155155
'<b>' +
156-
preview_i.slice(textIndex2, textIndex2 + term.length) +
156+
preview_i.slice(textIndex2, textIndex2 + term.length).replace(/</g, "&lt").replace(/>/g, "&gt") +
157157
'</b>'
158158
preview_i = preview_i.slice(textIndex2 + term.length)
159159
}

0 commit comments

Comments
 (0)