mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use escapeHTML on book chapter titles
This commit is contained in:
parent
38d8cafc73
commit
55f5a78f5e
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import escapeHTML from 'escape-html';
|
||||||
import dialogHelper from '../../components/dialogHelper/dialogHelper';
|
import dialogHelper from '../../components/dialogHelper/dialogHelper';
|
||||||
|
|
||||||
export default class TableOfContents {
|
export default class TableOfContents {
|
||||||
|
@ -56,7 +57,7 @@ export default class TableOfContents {
|
||||||
|
|
||||||
// remove parent directory reference from href to fix certain books
|
// remove parent directory reference from href to fix certain books
|
||||||
const link = chapter.href.startsWith('../') ? chapter.href.slice(3) : chapter.href;
|
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) {
|
if (chapter.subitems?.length) {
|
||||||
const subHtml = chapter.subitems
|
const subHtml = chapter.subitems
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue