diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-06-26 18:02:41 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-06-26 18:02:41 +0300 |
| commit | 9b3a3d168098f3af024e8d0b98616ed620842668 (patch) | |
| tree | ee1a0c259ab0819d1c8632f33ce6fb3e16dee48e /src | |
| parent | 3ac7050d6cd976d662457b51f57a9e34176b2158 (diff) | |
| download | the-epube-9b3a3d168098f3af024e8d0b98616ed620842668.tar.gz the-epube-9b3a3d168098f3af024e8d0b98616ed620842668.tar.xz | |
use escapeHtml for remaining unescaped frontend markup generation
Diffstat (limited to 'src')
| -rw-r--r-- | src/reader.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/reader.js b/src/reader.js index 1067882..8ff7aab 100644 --- a/src/reader.js +++ b/src/reader.js @@ -582,7 +582,7 @@ class ReaderClass extends AppCommon { }); if (toc_entry && toc_entry.label) - $(".chapter_title").html(toc_entry.label.trim() + " | "); + $(".chapter_title").text(this.escapeHtml(toc_entry.label.trim()) + " | "); this.generateTocBar(book, this.flattenToc(book)); } @@ -792,7 +792,7 @@ class ReaderClass extends AppCommon { const a = $("<a>") .attr('href', '#') - .html("<b class='pull-right'>" + toc_loc_msg(row.href) + "</b>" + row.label) + .html("<b class='pull-right'>" + toc_loc_msg(row.href) + "</b>" + _reader.escapeHtml(row.label)) .attr('data-href', row.href) .click(function() { book.rendition.display(a.attr('data-href')); @@ -821,7 +821,7 @@ class ReaderClass extends AppCommon { try { const a = $("<a>") .attr('href', '#') - .html("<b class='pull-right'>" + toc_loc_msg(row.href) + "</b>" + row.label) + .html("<b class='pull-right'>" + toc_loc_msg(row.href) + "</b>" + _reader.escapeHtml(row.label)) .attr('data-href', row.href) .click(function() { book.rendition.display(a.attr('data-href')); @@ -1395,7 +1395,7 @@ class ReaderClass extends AppCommon { if (data.data) { - $(".dict_result").html(data.data.result.join("<br/>")); + $(".dict_result").html(data.data.result.map((r) => this.escapeHtml(String(r))).join("<br/>")); $(".dict_query").val(word); if (callback) callback(); |
