summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-04-15 12:37:58 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-04-15 12:37:58 +0900
commit7378c4a9d8c8c48a8ecf043d7a8e27b0d013f335 (patch)
tree9146ef7c8b70d235c46d748a5d8954ae1b370e2b /src/client/components
parentUpdate yarn.lock (diff)
downloadsharkey-7378c4a9d8c8c48a8ecf043d7a8e27b0d013f335.tar.gz
sharkey-7378c4a9d8c8c48a8ecf043d7a8e27b0d013f335.tar.bz2
sharkey-7378c4a9d8c8c48a8ecf043d7a8e27b0d013f335.zip
fix #7444
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/mfm.ts11
1 files 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, ' ')];
}