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

add option to force insert line breaks to highlighting code. #329

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dindinw
Copy link

@dindinw dindinw commented Feb 8, 2016

option_highlight_line_break

Add a option which allow force insert <br> into the <pre> of the syntax highlighting code in the case when CSS "write-space:pre" not work. The option is off by default.

screen shot 2016-02-09 at 1 30 45 am

enable the option, let the line breaks work in the case.

after_hightlight_break

@liudongmiao
Copy link

+1

@adam-p And if you want to merge this, I'll add a Chinese translation for this patch.

@concefly
Copy link

concefly commented Oct 1, 2016

I really think so. +1

@adam-p
Copy link
Owner

adam-p commented Oct 27, 2017

In what scenario does "write-space:pre" not work? I don't mind adding this, but I need to know why.

@dindinw
Copy link
Author

dindinw commented Oct 31, 2017

@adam-p originally, the issue I had faced when I tried to use wechat's editor(https://mp.weixin.qq.com/) to publish my articles, which failed to handle the line-breaks of the syntax highlighted code lines. I can't remember the details and reason why"write-space:pre"not work in the case after a long period of time, Sorry for my bad memory. Anyway, force to replace '\n' to <br> fix the issue.
hope this helps
-Alex

@lonnyzhang423
Copy link

+1

@adam-p
Copy link
Owner

adam-p commented Nov 25, 2024

@dindinw Can you sign a CLA and add it to the PR, like is described here: https://github.com/adam-p/markdown-here/blob/master/CONTRIBUTING.md#contributor-license-agreement

I'm inclined to merge this PR (after all this time), but I also wonder if it wouldn't just be better to use <br> unconditionally, without an option. But I guess having the option basically allows it to be tested in the wild for a while first.

@dindinw
Copy link
Author

dindinw commented Nov 26, 2024

@adam-p
I am not sure the fix still work after so long time, I fix the conflict without testing anyway, hope it works.

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

Successfully merging this pull request may close these issues.

5 participants