From 27fe779a17fe4dce542bef0f1b683914ce8b7949 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Mon, 9 Oct 2023 22:17:36 +0100 Subject: [PATCH 1/8] feat: beautiful code markdown --- src/assets/styles/components/_chat.scss | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/assets/styles/components/_chat.scss b/src/assets/styles/components/_chat.scss index 0e292925b..298bfedcb 100644 --- a/src/assets/styles/components/_chat.scss +++ b/src/assets/styles/components/_chat.scss @@ -196,19 +196,16 @@ $scroll-bar-width: 4px; word-wrap: break-word; code { - line-height: 1rem; - color: #2e7eed; + + color: #ffffff; font-weight: inherit; font-size: 12px; - padding: 8px; - margin-bottom: 8px; - tab-size: 4; - border-radius: 4px; - border-style: solid; - border-width: 1px; - border-color: rgb(224, 224, 224); + padding: 2px 4px; + border-radius: 6px; + background-color: map-get($adm-colors, 'regular'); overflow-x: auto; max-width: 100%; + } code:before { From 300e5f684a08281c19f167db2d9b4545ed66f2e4 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Wed, 11 Oct 2023 04:27:56 +0100 Subject: [PATCH 2/8] fix(markdown): inline and multiline code --- src/assets/styles/components/_chat.scss | 40 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/assets/styles/components/_chat.scss b/src/assets/styles/components/_chat.scss index 298bfedcb..49d841ea3 100644 --- a/src/assets/styles/components/_chat.scss +++ b/src/assets/styles/components/_chat.scss @@ -196,17 +196,15 @@ $scroll-bar-width: 4px; word-wrap: break-word; code { - - color: #ffffff; font-weight: inherit; - font-size: 12px; + font-size: 14px; padding: 2px 4px; border-radius: 6px; - background-color: map-get($adm-colors, 'regular'); overflow-x: auto; max-width: 100%; - - } + tab-size: 4; + line-height:24px + } code:before { letter-spacing: inherit; @@ -233,15 +231,12 @@ $scroll-bar-width: 4px; padding: 8px; margin-bottom: 8px; tab-size: 4; - border-radius: 4px; - border-style: solid; - border-width: 1px; + border-radius: 6px; overflow-x: auto; max-width: 100%; - border-color: rgb(224, 224, 224); - - code:before { - content: ''; + + code{ + padding: 0px; } } } @@ -441,6 +436,11 @@ $scroll-bar-width: 4px; color: map-get($blue, 'base'); } + code{ + background-color: map-get($grey, 'lighten-4'); + color: map-get($grey, 'darken-3'); + border-color: map-get($grey, 'lighten-2');} + pre { background-color: map-get($grey, 'lighten-4'); color: map-get($grey, 'darken-3'); @@ -534,10 +534,22 @@ $scroll-bar-width: 4px; a { color: map-get($blue, 'lighten-2'); } + + code{ + color: #ffffff; + border-color: map-get($grey, 'darken-2'); + background-color: map-get($adm-colors, 'secondary2-slightly-transparent'); + } pre { - background-color: map-get($grey, 'darken-4'); + color: inherit; border-color: map-get($grey, 'darken-2'); + background-color: map-get($adm-colors, 'secondary2-slightly-transparent') !important; + + + code { + background-color: transparent; + } } } From e6c1aa42c49691184fd305ee30e6b805c326c033 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Wed, 11 Oct 2023 09:10:01 +0100 Subject: [PATCH 3/8] fix: code formatting --- src/assets/styles/components/_chat.scss | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/assets/styles/components/_chat.scss b/src/assets/styles/components/_chat.scss index 49d841ea3..8cce7b2cb 100644 --- a/src/assets/styles/components/_chat.scss +++ b/src/assets/styles/components/_chat.scss @@ -203,8 +203,8 @@ $scroll-bar-width: 4px; overflow-x: auto; max-width: 100%; tab-size: 4; - line-height:24px - } + line-height: 24px; + } code:before { letter-spacing: inherit; @@ -234,8 +234,8 @@ $scroll-bar-width: 4px; border-radius: 6px; overflow-x: auto; max-width: 100%; - - code{ + + code { padding: 0px; } } @@ -436,10 +436,11 @@ $scroll-bar-width: 4px; color: map-get($blue, 'base'); } - code{ + code { background-color: map-get($grey, 'lighten-4'); color: map-get($grey, 'darken-3'); - border-color: map-get($grey, 'lighten-2');} + border-color: map-get($grey, 'lighten-2'); + } pre { background-color: map-get($grey, 'lighten-4'); @@ -535,18 +536,16 @@ $scroll-bar-width: 4px; color: map-get($blue, 'lighten-2'); } - code{ - color: #ffffff; + code { + color: map-get($shades, 'white'); border-color: map-get($grey, 'darken-2'); background-color: map-get($adm-colors, 'secondary2-slightly-transparent'); } pre { - color: inherit; border-color: map-get($grey, 'darken-2'); - background-color: map-get($adm-colors, 'secondary2-slightly-transparent') !important; + background-color: map-get($adm-colors, 'secondary2-slightly-transparent'); - code { background-color: transparent; } From 2f4fbc6ae65e8ca88a723cc79fc525c219d93a22 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 13 Oct 2023 17:11:07 +0100 Subject: [PATCH 4/8] Test programs with different fonts --- src/App.vue | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index ce782b3c9..98477a5ba 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,24 @@ @@ -21,7 +36,8 @@ export default defineComponent({ }, data: () => ({ showWarningOnAddressesDialog: false, - notifications: null as Notifications | null + notifications: null as Notifications | null, + font: "'Exo 2', sans-serif" }), computed: { layout() { @@ -63,7 +79,7 @@ export default defineComponent({ }) - From 48c3fbd30b6f6b70da5d388d9eddceb101cf397e Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 13 Oct 2023 21:27:04 +0100 Subject: [PATCH 5/8] Added another font --- src/App.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.vue b/src/App.vue index 98477a5ba..f8f53239d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,6 +18,11 @@ + From 80d0ba3c029129606ca7b22ced0a5616d51b1d11 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 3 Nov 2023 21:11:02 +0000 Subject: [PATCH 6/8] Revert "Added another font" This reverts commit 48c3fbd30b6f6b70da5d388d9eddceb101cf397e. --- src/App.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index f8f53239d..98477a5ba 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,11 +18,6 @@ - From 12c1aabf8dcb5ad80d7732369da6fff8390b71f4 Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 3 Nov 2023 21:11:13 +0000 Subject: [PATCH 7/8] Revert "Test programs with different fonts" This reverts commit 2f4fbc6ae65e8ca88a723cc79fc525c219d93a22. --- src/App.vue | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/App.vue b/src/App.vue index 98477a5ba..ce782b3c9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,24 +1,9 @@ @@ -36,8 +21,7 @@ export default defineComponent({ }, data: () => ({ showWarningOnAddressesDialog: false, - notifications: null as Notifications | null, - font: "'Exo 2', sans-serif" + notifications: null as Notifications | null }), computed: { layout() { @@ -79,7 +63,7 @@ export default defineComponent({ }) - From ac06c1bd46ef496242ef8f2ec2dd54676247bbfb Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 3 Nov 2023 21:48:55 +0000 Subject: [PATCH 8/8] fix(markdown): reply preview shows empty message when quoting multiline code message --- src/lib/markdown.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/markdown.js b/src/lib/markdown.js index 12be19903..54bf0dda8 100644 --- a/src/lib/markdown.js +++ b/src/lib/markdown.js @@ -56,11 +56,8 @@ export function renderMarkdown (text = '') { * @returns {string} resulting clear text of the first line */ export function removeFormats (text = '') { - // get first line - const line = /^([^\n]*)\n?/.exec(text)[1] - const node = document.createElement('div') - node.innerHTML = marked(DOMPurify.sanitize(line), { renderer }) + node.innerHTML = marked(DOMPurify.sanitize(text), { renderer }) return node.textContent || node.innerText || '' }