Inline Code Block Handling Issue in Chromium-Based Browsers #1102
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.
Dear Owner,
Regarding the handling of inline code blocks, I’ve encountered an issue specifically in Microsoft Edge. When translating, it moves all
<code>
tags to the end of the paragraph, causing formatting disruptions and readability challenges.After testing, I found that wrapping
<code>
tags with<span>
resolves the issue, allowing proper parsing and translation.This issue seems to stem from the browser itself. Notably, it does not occur in Safari. Initially, I thought this was limited to Edge, but further investigation revealed that all Chromium-based browsers exhibit this behavior when processing
<code>
tags. They tend to move these tags to the end of the text block during translation.Interestingly, this bug appears to have existed since 2020 (or perhaps even earlier), as documented in the following references:
Edge's built-in translation breaks typography
The translator always move the code tag content to the end
As a workaround, adding
<span>
tags around the<code>
blocks has proven to be an effective solution. While not ideal, it ensures readability and proper translation behavior across affected browsers. I hope this insight can help others encountering the same issue.Best regards,
Wells