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.
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.
@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.
curbengh
left a comment
There was a problem hiding this comment.
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-landscapeis not using toc helper, I have set up a benchmark using myhexo-theme-suka, with hexo'smeta_generatorandexternal_linkdisabled.Node.js 8
Nodejs.10
Nodejs.12
Pull request tasks