fix handling of plain MFM tag

This commit is contained in:
Johann150 2023-11-24 16:43:03 +01:00
parent 101ea21747
commit 8b16ead35c
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -51,6 +51,10 @@ export default defineComponent({
const genEl = (ast: mfm.MfmNode[]) => ast.map((token): VNode | VNode[] => {
switch (token.type) {
case 'plain':
// for some reason `<plain>` is a token which just wraps a single text node
token = token.children[0];
// fallthrough
case 'text': {
const text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n');