refactor: Introduce list of MFM Functions (#7882)
* introduce list of MFM Functions * add note
This commit is contained in:
parent
34ea3cf226
commit
1c38c7010d
5 changed files with 33 additions and 6 deletions
|
|
@ -1,9 +1,10 @@
|
|||
import * as mfm from 'mfm-js';
|
||||
import { fnNameList } from '@/mfm/fn-name-list';
|
||||
import { Note } from '@/models/entities/note';
|
||||
import { toHtml } from '../../../mfm/to-html';
|
||||
|
||||
export default function(note: Note) {
|
||||
let html = note.text ? toHtml(mfm.parse(note.text), JSON.parse(note.mentionedRemoteUsers)) : null;
|
||||
let html = note.text ? toHtml(mfm.parse(note.text, { fnNameList }), JSON.parse(note.mentionedRemoteUsers)) : null;
|
||||
if (html == null) html = '<p>.</p>';
|
||||
|
||||
return html;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue