Fix: remove escapeHtml completely
This commit is contained in:
parent
39df704591
commit
431dbdc81c
|
@ -1,4 +1,4 @@
|
|||
/* global semverCompare escapeHtml */
|
||||
/* global semverCompare */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* global CodeMirror messageBox */
|
||||
/* global editors makeSectionVisible showCodeMirrorPopup showHelp */
|
||||
/* global onDOMscripted injectCSS require CSSLint stylelint */
|
||||
/* global escapeHtml */
|
||||
'use strict';
|
||||
|
||||
loadLinterAssets();
|
||||
|
|
11
js/dom.js
11
js/dom.js
|
@ -272,14 +272,3 @@ function $element(opt) {
|
|||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
|
||||
function escapeHtml(html, {limit} = {}) {
|
||||
const chars = {'&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '/': '/'};
|
||||
let ellipsis = '';
|
||||
if (limit && html.length > limit) {
|
||||
html = html.substr(0, limit);
|
||||
ellipsis = '...';
|
||||
}
|
||||
return html.replace(/[&<>"'/]/g, char => chars[char]) + ellipsis;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user