-
Notifications
You must be signed in to change notification settings - Fork 331
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
Linebreaks in the middle of ++
#1862
Comments
Thank you @Maria-12648430. Looking at the CSS rules, we can't tell the browser to only break on whitespaces. We can tell it to not break at all though, but may cause strangeness in other places. Thoughts? |
Yeah, I agree... I checked in the old/current Erlang docs, and the same thing happens there if you play with the browser window size. I have never actually seen it happen before, so it probably doesn't happen often, and in the instance I posted, the The only solution that I think of would be to make the formatter wrap some extra CSS that prevents linebreaks around operators like |
I don't think that CSS can be used for that, but if ex_doc does some text transformation for compound operators like |
The things you learn... 🤪 But seriously, if that works, it would be a better option than what I suggested IMO |
Indeed. I would have suggested the Zero-Width Joiner, but that is the path to zalgo text if you're not using Emoji or languages that need it to form different connectors (e.g., Arabic). The advantage to the CSS approach is that it depends on wrapping the operators in a span with a class rather than changing their text representation. The difficulty with either approach is appropriately detecting exactly the forms required, and not matching a potentially decorative |
Unfortunately I am thinking we should go ahead and close this, because I don't think there is any straight-forward solution to the problem at the moment. :( |
Ah well 😢 I understand, but personally I would prefer to leave it open, as a reminder and eyecatcher in case somebody with a bright idea happens to drop by 😉 |
In this case I think EarMark's attributes would solve the problem, although it does mean having to do it manually for each item you want this to apply to, but you can do something like this: `apply(M, F, A++ExtraArgs)`{: .no-break} And then define |
I just tested the new documentation generation for OTP which uses
ex_doc
and noticed that linebreaks can occur right in the middle of++
, see below.There are probably more instances where linebreaks can occur in strange places. Generally, I would expect that linebreaks only happen at whitespaces.
The text was updated successfully, but these errors were encountered: