diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-09 03:40:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-09 03:40:40 +0900 |
| commit | 54cb94db1d76d47633aab970c24993c4afde890b (patch) | |
| tree | 518ca899db0dc044e303f8c4c0a9da9d4825e130 /src | |
| parent | #2501 (diff) | |
| download | misskey-54cb94db1d76d47633aab970c24993c4afde890b.tar.gz misskey-54cb94db1d76d47633aab970c24993c4afde890b.tar.bz2 misskey-54cb94db1d76d47633aab970c24993c4afde890b.zip | |
Eliminate if-statement (#3555)
Diffstat (limited to 'src')
| -rw-r--r-- | src/mfm/html.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/mfm/html.ts b/src/mfm/html.ts index a08666646d..50d26e10e6 100644 --- a/src/mfm/html.ts +++ b/src/mfm/html.ts @@ -126,11 +126,7 @@ export default (tokens: Node[], mentionedRemoteUsers: INote['mentionedRemoteUser const nodes = (token.props.text as string).split('\n').map(x => doc.createTextNode(x)); for (const x of intersperse('br', nodes)) { - if (x === 'br') { - el.appendChild(doc.createElement('br')); - } else { - el.appendChild(x); - } + el.appendChild(x === 'br' ? doc.createElement('br') : x); } return el; |