feat: support <plain> syntax for mfm
This commit is contained in:
@@ -145,6 +145,12 @@ export function toHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMenti
|
||||
a.textContent = node.props.content;
|
||||
return a;
|
||||
},
|
||||
|
||||
plain(node) {
|
||||
const el = doc.createElement('span');
|
||||
appendChildren(node.children, el);
|
||||
return el;
|
||||
},
|
||||
};
|
||||
|
||||
appendChildren(nodes, doc.body);
|
||||
|
||||
@@ -312,6 +312,10 @@ export default defineComponent({
|
||||
})];
|
||||
}
|
||||
|
||||
case 'plain': {
|
||||
return [h('span', genEl(token.children))];
|
||||
}
|
||||
|
||||
default: {
|
||||
console.error('unrecognized ast type:', token.type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user