mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 06:44:27 +01:00
commit
ba8a410d4c
@ -147,6 +147,16 @@
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function sanitizeHTMLEntities(str) {
|
||||
if (str && typeof str === 'string') {
|
||||
str = str.replace(/</g,"<");
|
||||
str = str.replace(/>/g,">");
|
||||
str = str.replace(/<em>/g,"<em>");
|
||||
str = str.replace(/<\/em>/g,"<\/em>");
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function httpGet(theUrl) {
|
||||
var xmlHttp = new XMLHttpRequest();
|
||||
xmlHttp.open("GET", theUrl, false); // false for synchronous request
|
||||
@ -169,7 +179,8 @@
|
||||
lastRequest.open("GET", theUrl, true);
|
||||
lastRequest.onload = function (e) {
|
||||
if (lastRequest.readyState === 4 && lastRequest.status === 200) {
|
||||
let httpResults = JSON.parse(lastRequest.responseText);
|
||||
let sanitizedResponseText = sanitizeHTMLEntities(lastRequest.responseText);
|
||||
let httpResults = JSON.parse(sanitizedResponseText);
|
||||
results.innerHTML = '';
|
||||
|
||||
let processingTimeMs = httpResults.processingTimeMs;
|
||||
|
Loading…
Reference in New Issue
Block a user