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

AsciiDoc TableOfContents doesn't handle code properly #7649

Closed
helfper opened this issue Sep 9, 2020 · 4 comments · Fixed by #7650
Closed

AsciiDoc TableOfContents doesn't handle code properly #7649

helfper opened this issue Sep 9, 2020 · 4 comments · Fixed by #7650
Labels

Comments

@helfper
Copy link
Contributor

helfper commented Sep 9, 2020

When a title in AsciiDoc contains `inlined code`, it doesn't appear in the table of contents and multiple entries are created with the text surrounding it.

For example, this AsciiDoc:

== Some `code` in the title

Will generate a TOC with two entries pointing to the same place:

  • Some
  • in the title

(This is handled correctly in Markdown.)

@nancym
Copy link

nancym commented Sep 14, 2020

I just installed v0.75.0/extended and none of my AsciiDoc TOCs are showing up. I use :toc: macro, which I wrote about in https://discourse.gohugo.io/t/asciidoc-and-toc-shortcode/19668/4. I really appreciate all the new AsciiDoc support so thank you all for that! For now, unfortunately, I need to revert to v0.74.3/extended.

@helfper
Copy link
Contributor Author

helfper commented Sep 14, 2020

@nancym That's because #7099 introduced a breaking change. I'm not a fan of the way things were done there, because it's a breaking change without leaving a flag to fall back on the previous behaviour. At the moment, it's not possible to preserve the ToC generated by Asciidoctor, you'd have to (re-)generate it on the Hugo side with the .TableOfContents variable.

@nancym
Copy link

nancym commented Sep 17, 2020

Thank you for #7702 (comment)! Meanwhile I've played around with .TableOfContents in AsciiDoc layout files and will probably eventually use this so that my .adoc and .md content TOCs will look the same. But it's great to have the option to use pre-existing AsciiDoc TOCs.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants