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

[BUG] Unable to render TOC in org-mode files #1121

Open
pace577 opened this issue Jan 5, 2023 · 1 comment
Open

[BUG] Unable to render TOC in org-mode files #1121

pace577 opened this issue Jan 5, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@pace577
Copy link

pace577 commented Jan 5, 2023

Describe the bug
When I try to generate the table of contents for a post with the ShowToc: true option, I don't see the TOC on the post as expected.

  • Device/Os: Manjaro
  • Type: Desktop
  • Browser and version: Mozilla Firefox 108.0.1
  • Hugo Version [ >=0.83.0 expected]: 0.108.0
  • Theme Version [e.g. v4.0, master, or commit-id ]: d3d90be

Steps to reproduce the behavior:

  1. Create an org file with hugo new post.org with at least one heading (Eg: * Heading )
  2. Add ShowToc: true in the front matter of post.
  3. Serve the site with hugo serve -D.
  4. Open the page and see that the TOC is not visible.

However, note that the TOC is displayed if a .md file was made instead of a .org file.

Expected behavior:
Table of Contents was supposed to appear as expected.

Additional context
Upon debugging, I found that changing the regexp in this line from <h[1-6].*?>(.|\n])+?</h[1-6]> to <h[1-6].*?>(.|\n)+?</h[1-6]> (removed a ] character in the middle) seems to give expected behaviour.

Making this change locally fixed the bug for me, but I do not understand why it happened!

@pace577 pace577 added the bug Something isn't working label Jan 5, 2023
@adityatelange
Copy link
Owner

I haven't tested this on org files. Using markdown is recommended with PaperMod

@adityatelange adityatelange added the help wanted Extra attention is needed label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants