Skip to content

Commit

Permalink
Fix markdown is rendered properly in episode's overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaitanya-Shahare committed Jun 8, 2024
1 parent 3bb9d44 commit a031aab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/components/listview/listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -415,8 +417,9 @@ export function getListViewHtml(options) {
}

if (enableOverview && item.Overview) {
const overview = DOMPurify.sanitize(markdownIt({ html: true }).render(item.Overview || ''));
html += '<div class="secondary listItem-overview listItemBodyText">';
html += '<bdi>' + item.Overview + '</bdi>';
html += '<bdi>' + overview + '</bdi>';
html += '</div>';
}

Expand Down

0 comments on commit a031aab

Please sign in to comment.