merge: handle more complex ruby from/to html - fixes #605 (!866)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/866

Closes #605

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Marie 2025-02-07 03:40:55 +00:00
commit 2928ccf1e4
3 changed files with 183 additions and 5 deletions

View file

@ -358,6 +358,10 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
return h('ruby', {}, [...genEl(token.children.slice(0, token.children.length - 1), scale), h('rt', text.trim())]);
}
}
case 'group': { // this is mostly a hack for the insides of `ruby`
style = '';
break;
}
case 'unixtime': {
const child = token.children[0];
const unixtime = parseInt(child.type === 'text' ? child.props.text : '');