How to wrap long lines inside of markdown ``` code ``` in Github and Gitlab issues?

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)

EDIT: see also https://github.com/softvar/enhanced-github/issues/95


Solution 1:

A quick workaround is to quote your codeblocks, e.g.

this line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long

Make sure you keep the three backticks inline with the very long line. Like this:

> ```this line is very long```

Solution 2:

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

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

Solution 3:

The imperfect workaround I currently use is to replace the

``` 

with a single backtick:

`

...and do that line by line. which is infeasible for larger code chunks, and also makes highlighting the code harder for viewers of the markdown. So this 'line by line' workaround is strongly inferior to a genuine code wrap for code contained inside ```.