how to line wrap long lines inside markdown ``` code blocks ``` in github&gitlab issues?

timotheecour picture timotheecour · Dec 20, 2016 · Viewed 24.9k times · Source

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; 
```

will force user to scroll in github/gitlab issues. Is there a way to soft-line wrap inside code block ?

I've read the related questions but they seem different (eg jekyll etc).

EDIT: manually editing code to limit to 80 columns is not a viable option (eg, when pasting from a compiler output/log etc; that's a lot of work and should not be necessary)

Answer

Tarun Khurana picture Tarun Khurana · Jun 6, 2019

Add below CSS in your output HTML file or edit it in the linked CSS

code {
  white-space : pre-wrap !important;
}