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

Goldmark passthrough LaTeX expressions not correctly reflected in .TableOfContents #12491

Open
DanilaFe opened this issue May 13, 2024 · 2 comments
Labels
Milestone

Comments

@DanilaFe
Copy link

It's been really exciting to see support for Mathematics in Makdown. I've had to spend years double-escaping my LaTeX expressions. Now, I'm eager to make the switch, but noticing a bug that will make the migration incomplete.

In my Markdown source, I have the following:

#### Aside: Vectors and Finite \(\mathbb{N}\)
Screenshot 2024-05-13 at 4 51 26 PM

This is great, but upon reviewing the diffs in terms of generated HTML, I noticed that following diff in the table of contents:

<         <li><a href="#aside-vectors-and-finite-mathbbn">Aside: Vectors and Finite \(\mathbb{N}\)</a></li>
---
>         <li><a href="#aside-vectors-and-finite-mathbbn">Aside: Vectors and Finite </a></li>

This is a change from what I had originally, which was double-escaped:

#### Aside: Vectors and Finite \\(\\mathbb{N}\\)

So, it seems that the Goldmark passthrough content isn't displayed in the auto-generated table of contents.

If it helps, my configuration for markup is as follows:

[markup]
  [markup.tableOfContents]
    endLevel = 4
    ordered = false
    startLevel = 3
  [markup.goldmark]
    [markup.goldmark.extensions]
      [markup.goldmark.extensions.passthrough]
        enable = true
        [markup.goldmark.extensions.passthrough.delimiters]
          block = [['\[', '\]'], ['$$', '$$']]
          inline = [['\(', '\)']]

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.125.7+extended darwin/arm64 BuildDate=2024-05-08T14:46:24Z VendorInfo=brew

Does this issue reproduce with the latest release?

Yup.

@jmooring
Copy link
Member

Until this is addressed, continue to double-escape your expressions when placing them in a heading when using .Page.TableOfContents.

@DanilaFe
Copy link
Author

Yep, that's what I've settled for. Thank you!

@bep bep removed the NeedsTriage label May 14, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants