-
I understand your point, but given that code blocks are specifically used for situations where every character matters, introducing new ones seems like a bad behaviour.
Context: https://www.lfgss.com/comments/16327731/
Fwiw the code block text reflows fine on my phone at a different point in the string. Your example string of numbers weirdly doesn't, it's one character too wide for the screen.
-
Fair enough, and I accept PRs.
The code in question is here: https://github.com/microcosm-cc/microcosm/blob/master/models/markdown.go#L193
It's a simple regex text replace on textual data within HTML. It is a fast, forward-only parser that is provided by the core Go team and this does not have context of the parent node merely the current node and type.
To fully achieve what you need we'd probably need a full DOM tree here to ensure we don't perform the replace text where an ancestor is a code or preformatted element.
Once done, you'd need to also ensure the CSS works cross-browser to ensure that the layout isn't broken for all comments... only for the comment that exceeds the standard width (as it won't now wrap). This is harder, as the version of Bootstrap is 6 years old, and the version of Django is 6 years old, and neither build any more. So you'd need to start by resolving all dependencies needed by Django and node so that you could build both again... then you could make the adjustments to Bootstrap and push them into the Django build which I could merge, build and then ship.
PRs happily accepted.
Or it's good enough as what you describe is an edge-case we can live with.
A soft hyphen is added to all text that is more than 40 chars long by design.
Why?
Because if we didn't then the mobile view would never be able to fit width on pages where there was long text. The soft hyphen is a unicode hint that this is a good place to wrap text.
An example:
1234567890123456789012345678901234567890ABCDEFGHIJ
Between the last zero and the letter A a soft hyphen should be inserted.
If you could view that (view source won't show it, you'd need to copy the above into something like Sublime Text and view non-printable chars) then it would look like this:
Where
<0xad>
is the soft-hyphen that says to a browser "if you're going to try and wrap but find that you cannot, you can do so here".https://en.wikipedia.org/wiki/Soft_hyphen