diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-12-09 03:44:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-09 03:44:37 +0900 |
| commit | 15b11e59f4575f3f791c7b12968545856bb319ce (patch) | |
| tree | fa9d2343ac9c455615538bc9dfd51cfc6645ed0f /src/client/app/common | |
| parent | Eliminate if-statement (#3561) (diff) | |
| download | misskey-15b11e59f4575f3f791c7b12968545856bb319ce.tar.gz misskey-15b11e59f4575f3f791c7b12968545856bb319ce.tar.bz2 misskey-15b11e59f4575f3f791c7b12968545856bb319ce.zip | |
Eliminate if-statement (#3562)
Diffstat (limited to 'src/client/app/common')
| -rw-r--r-- | src/client/app/common/views/components/mfm.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/client/app/common/views/components/mfm.ts b/src/client/app/common/views/components/mfm.ts index 7b0f8bd170..ecb22b6bc4 100644 --- a/src/client/app/common/views/components/mfm.ts +++ b/src/client/app/common/views/components/mfm.ts @@ -67,14 +67,9 @@ export default Vue.component('misskey-flavored-markdown', { render(createElement) { if (this.text == null || this.text == '') return; - let ast: Node[]; - - if (this.ast == null) { - // Parse text to ast - ast = parse(this.text, this.plainText); - } else { - ast = this.ast as Node[]; - } + const ast = this.ast == null ? + parse(this.text, this.plainText) : // Parse text to ast + this.ast as Node[]; let bigCount = 0; let motionCount = 0; |