From 39ed02bc53449f5ffd378d0db8d3ea22d768acd8 Mon Sep 17 00:00:00 2001 From: marihachi Date: Thu, 15 Apr 2021 12:10:16 +0900 Subject: [PATCH 01/15] apply hotfix of MFM parser (#7446) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6f3b71b74..d503890513 100644 --- a/package.json +++ b/package.json @@ -181,7 +181,7 @@ "markdown-it": "12.0.4", "markdown-it-anchor": "7.1.0", "matter-js": "0.16.1", - "mfm-js": "0.14.0", + "mfm-js": "0.14.1", "mocha": "8.3.2", "moji": "0.5.1", "ms": "2.1.3", From 89e7ef36dc34b487d1c23b1414e90f84ad14b931 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 15 Apr 2021 12:37:32 +0900 Subject: [PATCH 02/15] Update yarn.lock --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb3c82ad9c..8d82c2a77d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6613,10 +6613,10 @@ methods@^1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -mfm-js@0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/mfm-js/-/mfm-js-0.14.0.tgz#0952ed6f0dd8553866bde7e646c3d5d3d23aeae9" - integrity sha512-snCiszquj6DIOARdgJfI8b6o9PbojAmJe1thrsBkUTxG+XG27rCOmjEL1kc1705XraJo0aVCLR9vE6YmjHiUQg== +mfm-js@0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/mfm-js/-/mfm-js-0.14.1.tgz#bd149a5c82bcac1b940cf65400922f0ebfab87ec" + integrity sha512-MWCvyd1a3/oLLlKKo19UIfVyBOGg2eM0lK5WZmTKZmz+LGLcFlglxe+kLTkhkJdpGCGKk28tWURQz/xSYNbT1g== dependencies: twemoji-parser "13.0.x" From 7378c4a9d8c8c48a8ecf043d7a8e27b0d013f335 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 15 Apr 2021 12:37:58 +0900 Subject: [PATCH 03/15] fix #7444 --- src/client/components/mfm.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts index b8e948a188..3b08c83c7f 100644 --- a/src/client/components/mfm.ts +++ b/src/client/components/mfm.ts @@ -58,10 +58,13 @@ export default defineComponent({ const text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n'); if (!this.plain) { - const x = text.split('\n') - .map(t => t == '' ? [h('br')] : [t, h('br')]); - x[x.length - 1].pop(); - return x; + const res = []; + for (const t of text.split('\n')) { + res.push(h('br')); + res.push(t); + } + res.shift(); + return res; } else { return [text.replace(/\n/g, ' ')]; } From 0dba5607a8f859e6df37b000b9b2685af2cb3d7b Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 15 Apr 2021 17:36:09 +0900 Subject: [PATCH 04/15] refactor --- src/client/pages/timeline.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/client/pages/timeline.vue b/src/client/pages/timeline.vue index 751137c942..1d92dbba81 100644 --- a/src/client/pages/timeline.vue +++ b/src/client/pages/timeline.vue @@ -1,6 +1,6 @@