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

Smart quote rendering should not happen inside HTML <code> blocks in Markdown content #9911

Closed
kaushalmodi opened this issue May 20, 2022 · 5 comments

Comments

@kaushalmodi
Copy link
Contributor

kaushalmodi commented May 20, 2022

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

$ hugo version
v0.99.1

Does this issue reproduce with the latest release?

Yes

Bug Recipe

Put this in your Markdown content file

In Nim, <code class="inline-src language-nim" data-lang="nim">echo "hello"</code> will print
_hello_.

Deployed test showing this issue

Expected output

The double quotes inside the HTML <code> block should have remained the exact same, as straight quotes.

Observed (incorrect) behavior

image

Those double quotes are getting transformed into curved quotes, probably by GoldMark.

References

@jmooring
Copy link
Member

yuin/goldmark#308

@kaushalmodi
Copy link
Contributor Author

@jmooring That's awesome! Thanks for taking time to come up with that bug recipe in Go. You are filling my Go-fu void 😃 .

@jmooring
Copy link
Member

The upstream maintainer is reluctant to make any changes. I'm not sure where that leaves us.

@kaushalmodi
Copy link
Contributor Author

kaushalmodi commented May 24, 2022

Closing this as it's out of the scope of Hugo.

I have a workaround for this problem .. use span tags around Markdown's quoted syntax for inline code blocks.

Below renders without the typographer messing up the quotes:

In Nim, <span class="inline-src language-nim" data-lang="nim">`echo "hello"`</span> will print _hello_.

@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 Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants