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

Html entities on table of content #368

Closed
finex opened this issue Jun 1, 2020 · 7 comments
Closed

Html entities on table of content #368

finex opened this issue Jun 1, 2020 · 7 comments
Labels

Comments

@finex
Copy link

finex commented Jun 1, 2020

Actual Behavior

I've a heading with something like

* Heading with three dots: ...

When org/ox-hugo generate the toc, the result is:

[Heading with three dots: ...](url)

(where url is the anchor to the section)

Then Hugo exports the following html:

<a href="url">Heading with three dots: &amp;hellip;</a>

Expected Behavior

Markdown/Hugo wants the html entity inside the link in order to generate the correct markup, so ox-hugo should generate the following markdown:

[Heading with three dots: &hellip;](url)

Then Hugo, with this markdown code, will produce the correct html output:

<a href="url">Heading with three dots: &hellip;</a>

Workaround:

I'm currently putting &hellip; on the org file but it's not a great solution.

What do you think about?

@finex
Copy link
Author

finex commented Jun 1, 2020

I've also noticed that if I put &amp; or simply & on the md file, Hugo will render this code in &amp; in each case, instead of &, so maybe there is a bug on their side.

@kaushalmodi
Copy link
Owner

kaushalmodi commented Jun 1, 2020

With this Markdown:

[Heading with three dots: ...](url)

Hugo is generating:

<a href="url">Heading with three dots: &amp;hellip;</a>

So it looks like a Hugo/Goldmark bug.

Can you create a ticket on the hugo repo?

@kaushalmodi
Copy link
Owner

Possible workaround in ox-hugo:

  • In org-hugo--headline-title, post process the heading string through org-html-convert-special-strings (See C-h v org-html-special-string-regexps).

@finex
Copy link
Author

finex commented Jun 1, 2020

With this Markdown:

[Heading with three dots: ...](url)

Hugo is generating:

<a href="url">Heading with three dots: &amp;hellip;</a>

So it looks like a Hugo/Goldmark bug.

Can you create a ticket on the hugo repo?

yes, of course, I will link here the ticket just for future reference :-)

@finex
Copy link
Author

finex commented Jun 1, 2020

Hugo bug reference: gohugoio/hugo#7346

@finex
Copy link
Author

finex commented Jun 5, 2020

@kaushalmodi hi, after some test I've found it was a theming problem due to missing | renderHTML on the custom render link template. :-)

@finex finex closed this as completed Jun 5, 2020
@mrprofessor
Copy link
Contributor

Ugh! I had the same issue. Thank you @finex @kaushalmodi

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