From 00e02888d232529cbd7acb0f0cbc1e567ca1bd58 Mon Sep 17 00:00:00 2001 From: Chaitanya-Shahare Date: Sun, 23 Jun 2024 11:42:23 -0400 Subject: [PATCH] Backport pull request #5680 from jellyfin-web/release-10.9.z Fix episode overview markdown render Original-merge: aed4ffa2cdf17e1120ec207ada2106140ebf15a7 Merged-by: thornbill Backported-by: Joshua M. Boniface --- CONTRIBUTORS.md | 1 + src/components/listview/listview.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8191689b63..2a928215b3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -88,6 +88,7 @@ - [David Angel](https://github.com/davidangel) - [Pithaya](https://github.com/Pithaya) - [Peter Santos](https://github.com/prsantos-com) +- [Chaitanya Shahare](https://github.com/Chaitanya-Shahare) ## Emby Contributors diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index 018a8a7b61..cd5fcf922e 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -17,6 +17,8 @@ import '../../elements/emby-ratingbutton/emby-ratingbutton'; import '../../elements/emby-playstatebutton/emby-playstatebutton'; import ServerConnections from '../ServerConnections'; import { getDefaultBackgroundClass } from '../cardbuilder/cardBuilderUtils'; +import markdownIt from 'markdown-it'; +import DOMPurify from 'dompurify'; function getIndex(item, options) { if (options.index === 'disc') { @@ -415,8 +417,9 @@ export function getListViewHtml(options) { } if (enableOverview && item.Overview) { + const overview = DOMPurify.sanitize(markdownIt({ html: true }).render(item.Overview || '')); html += '
'; - html += '' + item.Overview + ''; + html += '' + overview + ''; html += '
'; }