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)
}
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({
props: {
@ -174,10 +173,11 @@ export default defineComponent({
key: Math.random(),
href: token.props.url,
rel: 'nofollow noopener'
})]
}, token.props.url)]
}
case 'link': {
console.log(token.props)
return [h('a', {
key: Math.random(),
href: token.props.url,
@ -250,6 +250,21 @@ export default defineComponent({
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: {
console.error('unrecognized ast type:', token.type)