问题描述
例如:
```
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;
```
将强制用户滚动 github/gitlab 问题.有没有办法在 code block
内进行软换行?
will force user to scroll in github/gitlab issues.Is there a way to soft-line wrap inside code block
?
我已阅读相关问题,但它们似乎不同(例如 jekyll 等).
I've read the related questions but they seem different (eg jekyll etc).
手动编辑代码以限制为 80 列不是一个可行的选项(例如,从编译器输出/日志等粘贴时;这是很多工作,应该没有必要)
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)
另见 https://github.com/softvar/enhanced-github/问题/95
推荐答案
快速的解决方法是引用您的代码块,例如
A quick workaround is to quote your codeblocks, e.g.
这一行非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常非常长
确保将三个反引号与很长的行保持一致.像这样:
Make sure you keep the three backticks inline with the very long line. Like this:
> ```this line is very long```
这篇关于如何在 Github 和 Gitlab 问题中的 markdown ``` 代码 ``` 中换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!