-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(backend): Let MfmService.fromHtml()
accept <ruby>
tags
#15117
Open
dahlia
wants to merge
1
commit into
misskey-dev:develop
Choose a base branch
from
dahlia:mfm-from-html-ruby
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+52
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
packages/backend
Server side specific issue/PR
packages/backend:test
labels
Dec 10, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #15117 +/- ##
===========================================
+ Coverage 39.96% 39.97% +0.01%
===========================================
Files 1563 1563
Lines 197752 197785 +33
Branches 3634 3644 +10
===========================================
+ Hits 79031 79069 +38
+ Misses 118116 118111 -5
Partials 605 605 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 |
関連: #12382 |
tesaguri
reviewed
Dec 10, 2024
This fix makes `MfmService.fromHtml()` method accept `<ruby>` tags and translate it to MFM's ruby characters syntax (`$[ruby ...]`). このパッチは`MfmService.fromHtml()`メソッドが`<ruby>`タグをMFMの 読み仮名(ルビ)文法に翻訳する様に修正します。
dahlia
force-pushed
the
mfm-from-html-ruby
branch
from
December 11, 2024 02:34
aa1de2c
to
a74cc14
Compare
I've addressed all of the things that @tesaguri pointed out! |
Can someone review this for me? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This fix makes
MfmService.fromHtml()
method accept<ruby>
tags and translate it to MFM's ruby characters syntax ($[ruby ...]
).このパッチは
MfmService.fromHtml()
メソッドが<ruby>
タグをMFMの読み仮名(ルビ)文法に翻訳する様に修正します。Why
Currently, Misskey can display ruby characters via MFM for posts received from other Misskey (and Forkeys) servers, but is unable to display them properly from other software, even if the
<ruby>
tag is present in thecontent
property. This fix should allow for better interoperability.現在、MisskeyはMisskey系のサーバーから受け取った投稿の場合、MFMを通じてルビ文字(読み仮名)の表示が出来ますが、それ以外のソフトウェアからは
content
プロパティ内に<ruby>
タグが入っていても正しく表示されません。この修正により、より相互運用性が改善されます。Additional info (optional)
Because HTML's
<ruby>
tag is much more expressive than MFM's yomigana (ruby character) syntax, it falls back to plain text rendering as before if it goes beyond what MFM can represent (for example, if it contains spaces).MFMの読み仮名(ルビ)の文法が表現できる範囲よりも、HTMLの
<ruby>
タグが表現できる範囲がはるかに広いため、MFMで表現できる範囲を超えた場合(例えば、空白を含む場合)、従来通りプレーンテキストレンダリングにフォールバックします。Checklist