Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code line is too long in code block. #2001

Open
3 tasks done
maoshengyang opened this issue Nov 18, 2017 · 7 comments
Open
3 tasks done

The code line is too long in code block. #2001

maoshengyang opened this issue Nov 18, 2017 · 7 comments

Comments

@maoshengyang
Copy link

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
Copy link
Author

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

@ivan-nginx
Copy link
Collaborator

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

@maoshengyang
Copy link
Author

maoshengyang commented Nov 18, 2017

@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~

@ivan-nginx
Copy link
Collaborator

ivan-nginx commented Nov 19, 2017

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.

@zhuzhuyule
Copy link
Contributor

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 !

@sli1989
Copy link

sli1989 commented Jan 26, 2018

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

@upupming
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants