From d68ad9a5159c462fb30560ff1990f591bd73a7ac Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Thu, 7 Mar 2024 15:41:18 +0300 Subject: [PATCH] Fix markdown lists --- package.json | 2 +- src/co/bookmarks/item/view.module.styl | 11 +++++++++++ src/co/common/safeMarkdown.js | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7472bd7d..9012087d 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.20", + "version": "5.6.21", "description": "", "author": "", "license": "ISC", diff --git a/src/co/bookmarks/item/view.module.styl b/src/co/bookmarks/item/view.module.styl index d581abf7..9ade1be6 100644 --- a/src/co/bookmarks/item/view.module.styl +++ b/src/co/bookmarks/item/view.module.styl @@ -111,6 +111,9 @@ -webkit-box-orient: vertical overflow: hidden overflow: clip + } + + .title, .excerpt { white-space: pre white-space: pre-wrap } @@ -126,6 +129,14 @@ font-size: 100% } + ul { + padding-inline-start: 1em; + } + + ol { + padding-inline-start: 1.2em; + } + * { margin: 0 } diff --git a/src/co/common/safeMarkdown.js b/src/co/common/safeMarkdown.js index 81788b29..bfb8e861 100644 --- a/src/co/common/safeMarkdown.js +++ b/src/co/common/safeMarkdown.js @@ -6,9 +6,9 @@ function safe(html) { return { dangerouslySetInnerHTML: { __html: DOMPurify.sanitize( - marked.parseInline(html, { silent: true }), + marked.parse(html, { silent: true, breaks: true }), { - ALLOWED_TAGS: ['i', 'b', 'strong', 'ul', 'ol', 'li', 'pre', 'code', 'em', 'blockquote', 'a'] + ALLOWED_TAGS: ['i', 'b', 'strong', 'ul', 'ol', 'li', 'pre', 'code', 'em', 'blockquote', 'a', 'p'] } ) }