diff options
| author | paihu <13479783+paihu@users.noreply.github.com> | 2023-12-02 17:09:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-02 17:09:22 +0900 |
| commit | cf3d45e7c89fb1d2103c04315bee27a546bef34f (patch) | |
| tree | c788fda8479b8d597a075033b0c965ac7fe8c8cc /packages/frontend/src/components | |
| parent | fix(backend): カスタム絵文字のインポート時の動作を修正 (#... (diff) | |
| download | misskey-cf3d45e7c89fb1d2103c04315bee27a546bef34f.tar.gz misskey-cf3d45e7c89fb1d2103c04315bee27a546bef34f.tar.bz2 misskey-cf3d45e7c89fb1d2103c04315bee27a546bef34f.zip | |
fix(frontend): MFM ruby nyaize (#12362)
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts index d4c3ef60aa..fe599dcead 100644 --- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts +++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts @@ -242,11 +242,17 @@ export default function(props: MfmProps) { case 'ruby': { if (token.children.length === 1) { const child = token.children[0]; - const text = child.type === 'text' ? child.props.text : ''; + let text = child.type === 'text' ? child.props.text : ''; + if (!disableNyaize && shouldNyaize) { + text = doNyaize(text); + } 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 : ''; + let text = rt.type === 'text' ? rt.props.text : ''; + if (!disableNyaize && shouldNyaize) { + text = doNyaize(text); + } return h('ruby', {}, [...genEl(token.children.slice(0, token.children.length - 1), scale), h('rt', text.trim())]); } } |