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 nested table of contents HTML #237

Merged
merged 1 commit into from
Sep 29, 2019
Merged

Conversation

TotalVerb
Copy link
Contributor

@TotalVerb TotalVerb commented Sep 28, 2019

HTML nested lists need to have the sublists contained within the parent <li>. This PR changes the TOC generation to perform this nesting, as well as to detect the highest heading level (so as not to generate an empty H1 entry if the page contains no H1 headings).

Before this PR, note how the numbering is strange (because the <ol> tags are not contained within the list item, so essentially numbering is reset to 1 whenever an <ol> tag is seen, instead of nesting):

Screenshot from 2019-09-28 16-48-18

After this PR, the problem is fixed:

Screenshot from 2019-09-28 17-20-36

@tlienart
Copy link
Owner

Hello and thanks so much for this! I've had a brief look and it looks great to me; it's a bit late here so I'll have a more in depth look tomorrow and will merge. Thanks a lot for taking the time.

@codecov
Copy link

codecov bot commented Sep 28, 2019

Codecov Report

Merging #237 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   88.15%   88.16%   +<.01%     
==========================================
  Files          28       28              
  Lines        1317     1318       +1     
==========================================
+ Hits         1161     1162       +1     
  Misses        156      156
Impacted Files Coverage Δ
src/misc_html.jl 100% <ø> (ø) ⬆️
src/converter/html_functions.jl 92.3% <100%> (+0.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dd2525...95b064e. Read the comment docs.

@TotalVerb
Copy link
Contributor Author

Of course, thank you so much for making this package!

@tlienart
Copy link
Owner

lgtm, thanks!

@tlienart tlienart merged commit c24a885 into tlienart:master Sep 29, 2019
@tlienart tlienart mentioned this pull request Sep 29, 2019
67 tasks
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.

2 participants