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

render article on the client using headlines data

This commit is contained in:
Andrew Dolgov
2018-12-08 09:32:14 +03:00
parent 41e967136f
commit bd66a9ef28
8 changed files with 135 additions and 156 deletions

View File

@@ -331,3 +331,16 @@ function popupOpenArticle(id) {
w.location = "backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id + "&csrf_token=" + App.getInitParam("csrf_token");
}
}
// htmlspecialchars()-alike for headlines data-content attribute
function escapeHtml(text) {
const map = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}