From 19725ca7cbadb8d186b22aecbac17b01139c2861 Mon Sep 17 00:00:00 2001 From: aineo <124525926+aineo@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:41:35 +0300 Subject: [PATCH 01/18] fix: broken links are shown as undefined --- src/lib/markdown.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/markdown.js b/src/lib/markdown.js index 92e2dda2f..1bcaeee3c 100644 --- a/src/lib/markdown.js +++ b/src/lib/markdown.js @@ -10,11 +10,11 @@ marked.setOptions({ const renderer = new marked.Renderer() -renderer.image = function (_href, _title, _text) { +renderer.image = function ({ _href, _title, _text }) { return '' } -renderer.link = function (href, title, text) { +renderer.link = function ({ href, _title, text }) { const linkPattern = /^(eth|bch|bitcoin|https?|s?ftp|magnet|tor|onion|tg):(.*)$/i const emailPattern = /^(mailto):[^@]+@[^@]+\.[^@]+$/i @@ -27,10 +27,12 @@ renderer.link = function (href, title, text) { return text } -renderer.heading = function (text) { +renderer.heading = function ({ text }) { return `

${text}

` } +marked.use({ renderer }) + /** * Sanitizes text to show HTML * @param {string} text text to sanitize @@ -46,7 +48,7 @@ export function sanitizeHTML(text = '') { * @returns {string} resulting sanitized HTML */ export function renderMarkdown(text = '') { - return marked(DOMPurify.sanitize(text), { renderer }) + return marked.parse(sanitizeHTML(text)) } /** @@ -58,7 +60,7 @@ export function renderMarkdown(text = '') { export function removeFormats(text = '') { const node = document.createElement('div') const textWithSymbol = text.replace(/\n/g, '↵ ') - node.innerHTML = marked(DOMPurify.sanitize(textWithSymbol), { renderer }) + node.innerHTML = marked.parse(sanitizeHTML(textWithSymbol)) return node.textContent || node.innerText || '' } @@ -66,7 +68,7 @@ export function removeFormats(text = '') { export function formatMessage(text = '') { const node = document.createElement('div') const textWithSymbol = text.replace(/\n/g, '↵ ') - node.innerHTML = marked(DOMPurify.sanitize(textWithSymbol), { renderer }) + node.innerHTML = marked.parse(sanitizeHTML(textWithSymbol)) const textWithoutHtml = node.textContent || node.innerText || '' const styledText = textWithoutHtml.replace(/↵/g, '') From d378d5206e2a8228c70a52715074c3e91f836b11 Mon Sep 17 00:00:00 2001 From: Ivanov N Date: Fri, 25 Oct 2024 11:02:19 +0300 Subject: [PATCH 02/18] fix: padding in styles --- src/components/NodesOfflineDialog.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/NodesOfflineDialog.vue b/src/components/NodesOfflineDialog.vue index f4d324cb9..7dc6f00ca 100644 --- a/src/components/NodesOfflineDialog.vue +++ b/src/components/NodesOfflineDialog.vue @@ -77,8 +77,11 @@ export default { @import '@/assets/styles/settings/_colors.scss'; .all-nodes-disabled-dialog { + &__card-title { + padding: 14px !important; + } &__card-text { - padding: 16px !important; + padding: 14px !important; } &__disclaimer { margin-top: 10px; From 42d5b8089ca5e6f2ca46ed2d2282aa425bbb4027 Mon Sep 17 00:00:00 2001 From: Ivanov N Date: Fri, 25 Oct 2024 12:02:24 +0300 Subject: [PATCH 03/18] fix: padding in styles for headers; padding s for the content are vuetify's default ones --- src/components/NodesOfflineDialog.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/NodesOfflineDialog.vue b/src/components/NodesOfflineDialog.vue index 7dc6f00ca..07029b2cd 100644 --- a/src/components/NodesOfflineDialog.vue +++ b/src/components/NodesOfflineDialog.vue @@ -77,11 +77,8 @@ export default { @import '@/assets/styles/settings/_colors.scss'; .all-nodes-disabled-dialog { - &__card-title { - padding: 14px !important; - } - &__card-text { - padding: 14px !important; + .a-text-header { + padding-left: 24px !important; } &__disclaimer { margin-top: 10px; From 2d1ee57bb7122271497bc66da201ec98a3b07855 Mon Sep 17 00:00:00 2001 From: Ivanov N Date: Fri, 25 Oct 2024 12:32:57 +0300 Subject: [PATCH 04/18] fix: padding in styles for the card's header with BEM rules --- src/components/NodesOfflineDialog.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/NodesOfflineDialog.vue b/src/components/NodesOfflineDialog.vue index 07029b2cd..12774ea5b 100644 --- a/src/components/NodesOfflineDialog.vue +++ b/src/components/NodesOfflineDialog.vue @@ -1,7 +1,7 @@