Skip to content

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Nov 2, 2019

What does it do?

Continuation of hexojs/hexo-util#112.
Alternative (less breaking thanhljs: true) approach to #3766

wrap is currently enabled by default, so codeblock is wrapped in <table>; disable it for simpler/shorter <pre><code>.

All credit to @seaoak

How to test

git clone -b highlight-wrap https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@curbengh
Copy link
Contributor Author

curbengh commented Nov 2, 2019

Pending release of hexojs/hexo-util#112.

Released.

@curbengh curbengh added this to the v4.1.0 milestone Nov 2, 2019
@coveralls
Copy link

coveralls commented Nov 2, 2019

Coverage Status

Coverage remained the same at 97.144% when pulling ca22689 on curbengh:highlight-wrap into 77f3e21 on hexojs:master.

@curbengh curbengh marked this pull request as ready for review November 4, 2019 10:53
@curbengh
Copy link
Contributor Author

curbengh commented Nov 4, 2019

Pending #3829 to test compatibility with [email protected].

@seaoak
Copy link
Member

seaoak commented Nov 4, 2019

@curbengh Thank you for making this PR!
This is exactly what I will make. 😄

BTW, do you think about codeblock tag plugin?
(the source file is lib/plugins/tag/code.js)

I think whether wrap: option should be added as a inline parameter as follows:

{% codeblock lang:js line_number:false wrap:false %}
const obj = {
    foo: 123
};
{% endcodeblock %}

If "yes", we should update document later.
https://hexo.io/docs/tag-plugins#Code-Block

Maybe it is better to make new PR about codeblock tag plugin.

@curbengh
Copy link
Contributor Author

curbengh commented Nov 5, 2019

BTW, do you think about codeblock tag plugin?

+1 on that, in a separate PR.

@curbengh
Copy link
Contributor Author

curbengh commented Nov 5, 2019

Rebased to include #3829

@curbengh curbengh requested a review from a team November 5, 2019 04:26
@curbengh curbengh mentioned this pull request Nov 9, 2019
2 tasks
SukkaW
SukkaW previously approved these changes Nov 9, 2019
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.

4 participants