-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add overflow-wrap
s to several elements currently overflowing
#1558
Conversation
To check (if somebody gets to any of these items before I do, feel free to mark as complete):
|
@LunarWatcher fixed another instance where we have an overflow: I've added a |
Not sure what to do about tag names, though - I am hesitant to just slap an |
I can't see an issue for this by searching for either "tag" or "tags" so we might not have it logged yet. I've only looked through the issue titles, so it's possible it's mentioned in the description or discussion of a related issue, but in that case it's probably worth it having its own issue anyway, so I've added #1559 |
Should we include #1249 in this issue as part of this list of things to check? |
If it's easy to do here, let's. If we encounter any complications, I think it's ok to defer because we already have an issue tracking that (so it won't be lost). On the long-tag-name case, a clip with ellipsis seems better than wrapping (doesn't have to be here), but: if we properly validate the length, does the case arise? How long can a tag name be without causing problems (remember smaller tablets)? Tag length can be configured (35 is the default, not baked in), but if any reasonable length would work, then we could fix the bug that allows long names to be created and not worry about how to wrap too-long tags. At least until somebody sees a use case for 100-character tags or something... |
For the sake of bookkeeping, there's also comment thread titles, but it wasn't a separate bullet because reasons
I'll check when I get around to it - did look for other issues, but didn't find that one. There's also #802, but I've been unable to reproduce it, so it might be fixed already |
I see the bug in the Math post linked in the issue. From discussion there, it seems to show up at some viewport sizes/zoom levels and not others. |
Oh, one of those bugs. I tried to reproduce it at several zoom levels and screen sizes, but couldn't. I'll try again later with more pixel-perfect resizing then |
FWIW, my browser reports that it is currently 1160px wide and at 100% zoom I see the bug on that Math answer (Brave, Chrome). I haven't done more exhaustive testing, but that's a datum, anyway. |
Not sure why this works, but MathJAX includes an assistive MathML container, and _that_ container appears to be the source of the overflow: > mathjax/MathJax#2936 (comment) The bug can also be fixed by overriding the positioning to not be `relative`, but I don't know if that has unintended consequences, and testing if it breaks positionally dependent mathjax is far more difficult than testing if it anything renders weirdly as a result of the max width statement. Firefox renders identically with or without it. There is also a small chance (based on comments) that Safari is affected by the same bug, but I use Linux and can't spin up a macOS VM to check (thanks, Apple). Closes codidact#802
d8322f4 probably needs a bit more manual testing than bbacd33, since the latter is limited to mathjax elements in any context. I don't think this should have unintended consequences, but I don't have that many test cases in my dev instance yet. Checked with the obvious troublemaker (tables), and it rendered fine: |
... bbacd33 might've broken long block equations. Checking now Update: It did not, I checked out Update 2: it wasn't, it was an HTML rendering difference. Changes to HTML generation means that |
At Some Point:tm:, the markdown generator stopped adding `<p>` wrappers around `mjx-container`, so any new posts with mathjax blocks (not inline mathjax), or existing posts that are edited, will start to overflow. (I think, I haven't checked if HTML is actually cached) For posterity, the HTML prior to whatever change happened can be seen on archive.org: https://web.archive.org/web/20250310184547/https://math.codidact.com/posts/286292
I can repro -- live Math post uses horizontal scroll and does not overflow; a copy of that same post in my dev environment sometimers overflows and sometimes uses h-scroll. In this screenshot I'm seeing different behavior for consecutive math blocks (though they're separated by single-line text); don't know yet if that's related: |
@cellio See update 2 in that comment, I figured out why it's being weird |
Oh good; I was working on assembling the list of mathjax for each of four equations of interest, but looks like I don't need to. |
Where does this PR stand? Are we waiting for review, or are reviewers waiting for changes? |
@cellio Awaiting either review, or confirmation of a performed review. No changes have been requested yet, unless I missed something on Discord or something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LunarWatcher I've added one more fix while we are at it (post history, initial revision) - with a scroll on overflow (preserves your fixes + ensures diffs display reasonably well when we can't wrap). CircleCI went into maintenance, so let's wait until it's up again before merging (just in case), and once it is - LGTM to me too.
P.S. Screenshots do not start from the same position, the width is the same
That can wait. But what happened to the tests? Is that the maintenance you mentioned? Will we need to manually kick them off later? |
Yup, all workflows are failing right now due to CircleCI's maintenance - if there will be no new commits after they wrap up, we will have to rerun the jobs manually (or they'll run automatically upon merge) |
Various instances of fixed overflow:
overflow-wrap: anywhere;
, becauseoverflow-wrap: break-word
did nothing - not sure if this has any unintended consequences, but it doesn't appear to have.Comments, which were the initial problem with #1478, appear to have been fixed. Since no source was linked on the meta post, I couldn't see the original, but a quick test setup with inline code showed that it did indeed wrap within width under 306284d. Comment content for the test was just a long series of letters without spaces wrapped in an inline codeblock, because that was the text that overflowed.
No title was used for this comment, however, so the auto-generated title did overflow. That has also been fixed, so comment thread titles now also wrap properly.
Various unhandled edge-cases:
overflow: clip
), but it requires adding it to quite a few more CSS classes, and just adding it everywhere feels unnecessaryOn that note, I'm not sure if it would be better to remove some of the added
overflow-wrap
s and throw then in a separate CSS class (has-overflow-break-word
or something), but this would require the classes1 added to a lot of elements for it to work properly.Closes #802
Closes #1249
Closes #1478
Footnotes
break-word
is the most common use-case, butanywhere
has a few applications as well - though nowhere near as many. Some also need an explicit width forbreak-word
to be properly respected, which may or may not be defined already for any given element. ↩