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

fix(tocObj): avoid checking length of null #166

Merged
merged 2 commits into from
Dec 24, 2019

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Dec 24, 2019

tocObj currently crashes hexo if the heading doesn't have id attribute, e.g. <h1>Title 1</h1>. This PR makes it more robust.

With this PR, in relation to the toc() helper, it would output

<a class="header-link" href="#null">

obviously anchor link wouldn't work, but at least there is a toc.

@curbengh curbengh requested a review from SukkaW December 24, 2019 07:06
@coveralls
Copy link

coveralls commented Dec 24, 2019

Coverage Status

Coverage remained the same at 96.774% when pulling 27ffc60 on curbengh:tocObj-null into 5e357d3 on hexojs:master.

@curbengh
Copy link
Contributor Author

I intend to bump patch after merging this.

@curbengh curbengh merged commit 6bcecec into hexojs:master Dec 24, 2019
@curbengh curbengh deleted the tocObj-null branch December 24, 2019 08:38
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.

3 participants