hexo-theme-next icon indicating copy to clipboard operation
hexo-theme-next copied to clipboard

The code line is too long in code block.

Open maoshengyang opened this issue 8 years ago • 7 comments

I agree and want to create new issue


Expected behavior

There shall be word-wrap in code block when the line is too long.

Actual behavior

The line will exceed the screen with a scroll bar as following. 2ba482f0-72ee-11e6-994a-5d364d11ddfa

Steps to reproduce the behavior

Just type a very long line.
  • Link to demo site with this issue: N/A
  • Link(s) to source code or any usefull link(s): N/A

Hexo Information

hexo-cli: 1.0.3
os: Darwin 16.7.0 darwin x64
http_parser: 2.7.0
node: 8.4.0
v8: 6.0.286.52
uv: 1.13.1
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.22.0
openssl: 1.0.2l
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b

NexT Information

NexT Version:

[x] Latest Master branch.
[] Latest Release version.
[] Old version - 

NexT Scheme:

[] All schemes
[] Muse
[] Mist
[x] Pisces
[] Gemini

Other Information

maoshengyang avatar Nov 18 '17 10:11 maoshengyang

Hi @ivan-nginx, Is there any solution? Thanks a lot!

maoshengyang avatar Nov 18 '17 10:11 maoshengyang

This is code block, what solution u want?

Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line Long line

ivan-nginx avatar Nov 18 '17 16:11 ivan-nginx

@ivan-nginx I just want the same style (font, background color, line number, etc.) with word-wrap. never mind. I'll find my own solution~

maoshengyang avatar Nov 18 '17 17:11 maoshengyang

This is code block. If u want to replace long words in new line, how it will be? Code is code. If code have long line, there is must whole lines. But if u just want word-wrap with syntax highlighting and code style, need to add option in config and add css style on code block. I see there is was solution, but i don't think what this is not good idea. I think better will be replace standart scrollbar with pretty-beauty other with addition code.

ivan-nginx avatar Nov 19 '17 00:11 ivan-nginx

you can see this style, create a scroll that folat in code area bottom always !

open this blog, then double click second code block and scroll change !

zhuzhuyule avatar Nov 22 '17 02:11 zhuzhuyule

maybe managing Line Lengths in notepad-plus-plus is an option. The github repo is here.

sli1989 avatar Jan 26 '18 05:01 sli1989

Finally, I choose to use word wrap to make long lines more suitable for human reading. I got my inspiration from MIT 6.031 readings' code style. And this is the result.

upupming avatar Jun 16 '18 23:06 upupming