-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
refactor(toc_helper): utilize hexo-util #3850
Conversation
After this PR is merged, I might begin to address #3288. |
This PR should be superseded by utilizing newer version of |
c483a4f
to
641dfd9
Compare
Can this PR use hexojs/hexo-util#137 branch temporarily for testing? Once that PR is released, just need to update hexo-util in this PR. |
max_depth: 6, | ||
class: 'toc', | ||
list_number: true | ||
}, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to add min_depth
option in this PR? Or in a separate PR (due to addition of unit test)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@curbengh No. The current unit test for toc helper is completely a mess. I might refactor the unit test when bringing up the min_depth
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally. Pending release of hexojs/hexo-util#137.
@curbengh |
3906d54
to
df7ebcb
Compare
@curbengh Rebased. It is now ready for review. |
That makes two features then. Sufficient for 4.2.0. #3891 can be deferred to 4.3+. |
* refactor(toc_helper): relpace cheerio with htmlparser2 * test(toc_helper): use classic for loop * refactor(toc_helper): utilize tocObj
What does it do?
This PR is the last pieces of #3677. We finally made it.
How to test
Screenshots
Since
hexo-theme-landscape
is not using toc helper, I have set up a benchmark using myhexo-theme-suka
, with hexo'smeta_generator
andexternal_link
disabled.Node.js 8
Nodejs.10
Nodejs.12
Pull request tasks