fix link display

This commit is contained in:
FloatingGhost 2022-06-14 17:07:46 +01:00
parent 9f764a4217
commit 38d1074992

View file

@ -7,8 +7,7 @@ function concat (xss) {
return ([]).concat(...xss) return ([]).concat(...xss)
} }
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate']; export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate']
export default defineComponent({ export default defineComponent({
props: { props: {
@ -174,10 +173,11 @@ export default defineComponent({
key: Math.random(), key: Math.random(),
href: token.props.url, href: token.props.url,
rel: 'nofollow noopener' rel: 'nofollow noopener'
})] }, token.props.url)]
} }
case 'link': { case 'link': {
console.log(token.props)
return [h('a', { return [h('a', {
key: Math.random(), key: Math.random(),
href: token.props.url, href: token.props.url,
@ -250,6 +250,21 @@ export default defineComponent({
return token.props.emoji return token.props.emoji
} }
case 'math': {
return [h('pre', {
key: Math.random(),
code: token.props.code
})]
}
case 'mathInline': {
return [h('pre', {
key: Math.random(),
code: token.props.code,
inline: true
})]
}
default: { default: {
console.error('unrecognized ast type:', token.type) console.error('unrecognized ast type:', token.type)