From f83364ce88289a75fdacae26521747fc1f5a57c4 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 e6f3b71b7..d50389051 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 67c8562122715229ff795ff237c271516e516bc9 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 fb3c82ad9..8d82c2a77 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 b9266cc36d95a0c1cfbcbed4a3e4ee01e35dd5c1 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 b8e948a18..3b08c83c7 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 03196dc7c9dc7138a0125858b0f2efc8b70e95bf 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 751137c94..1d92dbba8 100644 --- a/src/client/pages/timeline.vue +++ b/src/client/pages/timeline.vue @@ -1,6 +1,6 @@