-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Math: Enable horizontal auto-scrolling #72633
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +238 B (+0.01%) Total Size: 2.19 MB
ℹ️ View Unchanged
|
|
Hm, not great that we already need to deprecate the first version. Wy doesn't it automatically break, is this normal? |
|
From what I've researched, I don't think auto-line-break is possible with native MathML. |
|
@ellatrix @t-hamano Line breaks seem to work. There are discussion Overall, overflow-x is not a responsive-friendly solution. |
|
@EldarAgalarov Thank you for looking into this in detail. Ideally, the text would automatically wrap based on the container width, but that's not supported yet, is it? By the way, I realized that manual line breaks are possible in the current Math block.
We may need to discuss whether to let the user decide the line break positions, and whether any default line breaking or overflow handling is necessary. |
|
What do we do for inline math (rich text format)? |
|
One of the purposes of this pull request is to ensure consistency between the editor and the front-end markup, so let's merge it for now. If many users consider automatic scrolling unnecessary, we can remove that CSS later. |
* Math: Enable horizontal auto-scrolling * Add comment Unlinked contributors: EldarAgalarov. Co-authored-by: t-hamano <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: wprashed <[email protected]>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: 235619e |

Closes #72611
What?
Add
overflow-x: autoto the Math block to prevent the formula from overflowing the content.Why?
Otherwise, the whole page will show horizontal scrolling.
How?
In the save function, the math element is used as a block wrapper. However, in Firefox, I found that overflow scrolling doesn't work on math elements.
Furthermore, for markup consistency with the editor, I'll add a div wrapper to the save function.
Testing Instructions
Screenshots or screencast