enhance(frontend): MFMでルビを振れるように

Resolve #9161
This commit is contained in:
syuilo 2023-11-17 13:09:56 +09:00
parent 5ab7e03804
commit b517d76084
5 changed files with 11 additions and 7 deletions

View file

@ -238,6 +238,12 @@ export default function(props: MfmProps) {
style = `background-color: #${color};`;
break;
}
case 'ruby': {
const child = token.children[0];
const text = child.type === 'text' ? child.props.text : '';
return h('ruby', {
}, [text.split(' ')[0], h('rt', text.split(' ')[1])]);
}
}
if (style == null) {
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children, scale), ']']);