diff --git a/content/install-user-css.js b/content/install-user-css.js index a8516782..eeb050a5 100644 --- a/content/install-user-css.js +++ b/content/install-user-css.js @@ -1,4 +1,4 @@ -/* global semverCompare escapeHtml */ +/* global semverCompare */ 'use strict'; diff --git a/edit/lint.js b/edit/lint.js index e56cd123..2b19f8c1 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -1,7 +1,6 @@ /* global CodeMirror messageBox */ /* global editors makeSectionVisible showCodeMirrorPopup showHelp */ /* global onDOMscripted injectCSS require CSSLint stylelint */ -/* global escapeHtml */ 'use strict'; loadLinterAssets(); diff --git a/js/dom.js b/js/dom.js index 3cfa47a3..249de722 100644 --- a/js/dom.js +++ b/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; -}