1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 12:35:56 +00:00

wip: feed editor client-side

This commit is contained in:
Andrew Dolgov
2021-02-20 10:26:09 +03:00
parent 545bcc3e4b
commit 9586c72a17
3 changed files with 290 additions and 23 deletions

View File

@@ -343,16 +343,20 @@ const App = {
});
},
// htmlspecialchars()-alike for headlines data-content attribute
escapeHtml: function(text) {
const map = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
escapeHtml: function(p) {
if (typeof p == "string") {
const map = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
return p.replace(/[&<>"']/g, function(m) { return map[m]; });
} else {
return p;
}
},
displayIfChecked: function(checkbox, elemId) {
if (checkbox.checked) {