summaryrefslogtreecommitdiff
path: root/js/App.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-20 10:26:09 +0300
committerAndrew Dolgov <[email protected]>2021-02-20 10:26:09 +0300
commit9586c72a17dabd907becebffc938add10c4a8626 (patch)
tree653abe66fb7840e60e33b643bfc154ce1a599c3a /js/App.js
parent545bcc3e4b65bb1f0914fd2b548fb62504ecf8c6 (diff)
wip: feed editor client-side
Diffstat (limited to 'js/App.js')
-rw-r--r--js/App.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/js/App.js b/js/App.js
index 764003ca9..a3618409a 100644
--- a/js/App.js
+++ b/js/App.js
@@ -343,16 +343,20 @@ const App = {
});
},
// htmlspecialchars()-alike for headlines data-content attribute
- escapeHtml: function(text) {
- const map = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;',
- "'": '&#039;'
- };
-
- return text.replace(/[&<>"']/g, function(m) { return map[m]; });
+ escapeHtml: function(p) {
+ if (typeof p == "string") {
+ const map = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#039;'
+ };
+
+ return p.replace(/[&<>"']/g, function(m) { return map[m]; });
+ } else {
+ return p;
+ }
},
displayIfChecked: function(checkbox, elemId) {
if (checkbox.checked) {