diff options
author | Andrew Dolgov <[email protected]> | 2021-02-20 10:26:09 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-20 10:26:09 +0300 |
commit | 9586c72a17dabd907becebffc938add10c4a8626 (patch) | |
tree | 653abe66fb7840e60e33b643bfc154ce1a599c3a /js/App.js | |
parent | 545bcc3e4b65bb1f0914fd2b548fb62504ecf8c6 (diff) |
wip: feed editor client-side
Diffstat (limited to 'js/App.js')
-rw-r--r-- | js/App.js | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -343,16 +343,20 @@ const App = { }); }, // htmlspecialchars()-alike for headlines data-content attribute - escapeHtml: function(text) { - const map = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - return text.replace(/[&<>"']/g, function(m) { return map[m]; }); + escapeHtml: function(p) { + if (typeof p == "string") { + const map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + return p.replace(/[&<>"']/g, function(m) { return map[m]; }); + } else { + return p; + } }, displayIfChecked: function(checkbox, elemId) { if (checkbox.checked) { |