How to line wrap long lines inside markdown `` `code blocks`` 'in github and gitlab problems?

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 the user to scroll through github / gitlab messages. Is there a way to wrap a wrapper inside a code block ?

I read related questions, but they seem different (like jekyll, etc.).

EDIT: manually editing code to limit up to 80 columns is not a viable option (for example, when pasting from compiler output / logs, etc., which is a lot of work and not necessary)

+20
source share
3 answers

It seems that this is not yet possible. But you can use some extensions to work on the markup - this chrome extension is pretty cool here, see github thread here for more

+3
source

I found the following solution for myself and tested it on "github":

1) Create a file with the suffix ".md"

2) Use the <div> tag to solve the requested goal - split the long lines into several to mark them as one line.

Example:

 <div>I am very long line</div> 

Will be considered as the following:

 I am very long line 
0
source

Add below CSS to your HTML output file or edit it in related CSS

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

Source: https://habr.com/ru/post/1261556/


All Articles