mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-25 02:46:43 -06:00
Eliminate if-statement (#3555)
This commit is contained in:
parent
1de8e1eeb1
commit
54cb94db1d
1 changed files with 1 additions and 5 deletions
|
@ -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));
|
const nodes = (token.props.text as string).split('\n').map(x => doc.createTextNode(x));
|
||||||
|
|
||||||
for (const x of intersperse('br', nodes)) {
|
for (const x of intersperse('br', nodes)) {
|
||||||
if (x === 'br') {
|
el.appendChild(x === 'br' ? doc.createElement('br') : x);
|
||||||
el.appendChild(doc.createElement('br'));
|
|
||||||
} else {
|
|
||||||
el.appendChild(x);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
|
|
Loading…
Reference in a new issue