summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2018-08-18 11:36:43 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2018-08-19 00:20:36 +0900
commitc0fbcee38a5be0d67237a42dd5faceeb298ce940 (patch)
treedd365627ee91f5731772bc2370c631ee6d8b59b6 /src
parentUpdate ja.yml (diff)
downloadmisskey-c0fbcee38a5be0d67237a42dd5faceeb298ce940.tar.gz
misskey-c0fbcee38a5be0d67237a42dd5faceeb298ce940.tar.bz2
misskey-c0fbcee38a5be0d67237a42dd5faceeb298ce940.zip
improve MFM to html
Diffstat (limited to 'src')
-rw-r--r--src/mfm/html.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mfm/html.ts b/src/mfm/html.ts
index c11bd55cf4..c53542ac8f 100644
--- a/src/mfm/html.ts
+++ b/src/mfm/html.ts
@@ -80,12 +80,12 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers:
},
text({ document }, { content }) {
- for (const text of content.split('\n')) {
- const node = document.createTextNode(text);
- document.body.appendChild(node);
-
- const br = document.createElement('br');
- document.body.appendChild(br);
+ const t = content.split('\n')
+ for (let i = 0; i < t.length; i++) {
+ document.body.appendChild(document.createTextNode(t[i]));
+ if (i != t.length - 1) {
+ document.body.appendChild(document.createElement('br'));
+ }
}
},