Use mfm-js for MFM parsing (#7415)
* wip * Update mfm.ts * wip * update mfmjs * refactor * nanka * Update mfm.ts * Update to-html.ts * Update to-html.ts * wip * fix test * fix test
This commit is contained in:
parent
b378066ebf
commit
1f4ae2f63a
31 changed files with 262 additions and 1771 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import * as mfm from 'mfm-js';
|
||||
import { Note } from '../../../models/entities/note';
|
||||
import { toHtml } from '../../../mfm/to-html';
|
||||
import { parse } from '../../../mfm/parse';
|
||||
|
||||
export default function(note: Note) {
|
||||
let html = toHtml(parse(note.text), JSON.parse(note.mentionedRemoteUsers));
|
||||
let html = note.text ? toHtml(mfm.parse(note.text), JSON.parse(note.mentionedRemoteUsers)) : null;
|
||||
if (html == null) html = '<p>.</p>';
|
||||
|
||||
return html;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue