Skip to content

Commit

Permalink
Use escapeHTML on book chapter titles
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lark authored and thornbill committed Nov 8, 2023
1 parent 38d8caf commit 55f5a78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/bookPlayer/tableOfContents.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import escapeHTML from 'escape-html';
import dialogHelper from '../../components/dialogHelper/dialogHelper';

export default class TableOfContents {
Expand Down Expand Up @@ -56,7 +57,7 @@ export default class TableOfContents {

// remove parent directory reference from href to fix certain books
const link = chapter.href.startsWith('../') ? chapter.href.slice(3) : chapter.href;
itemHtml += `<a href="${book.path.directory + link}">${chapter.label}</a>`;
itemHtml += `<a href="${escapeHTML(book.path.directory + link)}">${escapeHTML(chapter.label)}</a>`;

if (chapter.subitems?.length) {
const subHtml = chapter.subitems
Expand Down

0 comments on commit 55f5a78

Please sign in to comment.