This commit is contained in:
syuilo
2018-09-17 02:45:30 +09:00
parent 6138a74231
commit 374b276f5c
2 changed files with 15 additions and 2 deletions

View File

@ -82,8 +82,12 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers:
text({ document }, { content }) {
const nodes = (content as string).split('\n').map(x => document.createTextNode(x));
for (const x of intersperse(document.createElement('br'), nodes)) {
document.body.appendChild(x);
for (const x of intersperse('br', nodes)) {
if (x === 'br') {
document.body.appendChild(document.createElement('br'));
} else {
document.body.appendChild(x);
}
}
},