We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eaa6914 commit 648c9aeCopy full SHA for 648c9ae
src/theme/searcher/searcher.js
@@ -145,6 +145,11 @@ window.search = window.search || {};
145
url.push("");
146
}
147
148
+ // encodeURIComponent escapes all chars that could allow an XSS except
149
+ // for '. Due to that we also manually replace ' with its url-encoded
150
+ // representation (%27).
151
+ var searchterms = encodeURIComponent(searchterms.join(" ")).replace(/\'/g, "%27");
152
+
153
return '<a href="' + path_to_root + url[0] + '?' + URL_MARK_PARAM + '=' + searchterms + '#' + url[1]
154
+ '" aria-details="teaser_' + teaser_count + '">' + result.doc.breadcrumbs + '</a>'
155
+ '<span class="teaser" id="teaser_' + teaser_count + '" aria-label="Search Result Teaser">'
0 commit comments