Skip to content
Snippets Groups Projects
Commit 6e0c055f authored by Acid Chicken (硫酸鶏)'s avatar Acid Chicken (硫酸鶏) Committed by Aya Morisawa
Browse files

Module 'jsdom' as import syntax (#4016)

parent 893a3b52
No related branches found
No related tags found
No related merge requests found
const jsdom = require('jsdom');
const { JSDOM } = jsdom;
import { JSDOM } from 'jsdom';
import config from '../config';
import { INote } from '../models/note';
import { intersperse } from '../prelude/array';
......@@ -158,9 +157,9 @@ export function toHtml(tokens: MfmForest, mentionedRemoteUsers: INote['mentioned
text(token) {
const el = doc.createElement('span');
const nodes = (token.node.props.text as string).split(/\r\n|\r|\n/).map(x => doc.createTextNode(x));
const nodes = (token.node.props.text as string).split(/\r\n|\r|\n/).map(x => doc.createTextNode(x) as Node);
for (const x of intersperse('br', nodes)) {
for (const x of intersperse<Node | 'br'>('br', nodes)) {
el.appendChild(x === 'br' ? doc.createElement('br') : x);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment