enhance(frontend): ruby内でMFMを使えるように
This commit is contained in:
parent
b517d76084
commit
43cb2d478c
|
@ -239,10 +239,15 @@ export default function(props: MfmProps) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'ruby': {
|
case 'ruby': {
|
||||||
const child = token.children[0];
|
if (token.children.length === 1) {
|
||||||
const text = child.type === 'text' ? child.props.text : '';
|
const child = token.children[0];
|
||||||
return h('ruby', {
|
const text = child.type === 'text' ? child.props.text : '';
|
||||||
}, [text.split(' ')[0], h('rt', text.split(' ')[1])]);
|
return h('ruby', {}, [text.split(' ')[0], h('rt', text.split(' ')[1])]);
|
||||||
|
} else {
|
||||||
|
const rt = token.children.at(-1)!;
|
||||||
|
const text = rt.type === 'text' ? rt.props.text : '';
|
||||||
|
return h('ruby', {}, [...genEl(token.children.slice(0, token.children.length - 1), scale), h('rt', text.trim())]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
|
|
Loading…
Reference in a new issue