From a031aab6222d425e260237f6d745cd47e77d3986 Mon Sep 17 00:00:00 2001 From: Chaitanya Shahare Date: Fri, 7 Jun 2024 13:55:39 +0530 Subject: [PATCH] Fix markdown is rendered properly in episode's overview --- 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 887c644822..d8d26d6062 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -87,6 +87,7 @@ - [JPUC1143](https://github.com/Jpuc1143) - [David Angel](https://github.com/davidangel) - [Pithaya](https://github.com/Pithaya) +- [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 += '
'; }