enhanced-github
enhanced-github copied to clipboard
feature request: wrap long lines inside markdown code blocks
See linked issue for the problem description: https://stackoverflow.com/questions/41238148/how-to-line-wrap-long-lines-inside-markdown-code-blocks-in-githubgitlab/67544049#67544049
Given the number of upvotes, it's a commonly requested feature.
The goal is to wrap code blocks, eg:
some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line;
See also https://github.com/yoheimuta/github-pre-utility which is relevant.
Has this feature been added? Is there a (built-in?) way to wrap texts inside the code block now?
old workaround:
for now: <code>....</code>, which is an inline element can help you with that. note that similar to pre, it will display the content as is, this means you can include EM/STRONG/SUB/SUP,etc... inside it. this also means that it is not text-encoding your content, so make sure to do it yourself. it also isn't applying any styling, it just shows a lot of text (including one with newlines in) across multiple lines.
![](https://user-images.githubusercontent.com/415238/153284932-2c9712cb-fa35-4fa2-9716-59155f814e55.png)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
it will favor whitespace for line-breaks otherwise if non exists it will simply wrap at character limit per-line (flows depending on the size of the container), you can not force it not to break on spaces but you can use instead of space, but as explained above, if it happens to reach the line end it may break on it anyway.
note: if there are too much (2+) new lines, github will insert a newline in-it, breaking the code tag, so always preview first, you can also insert BR or HR tags in instead of linebreaks you would normally have.