-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Render Markdown in figure (shortcode) captions #4406
Comments
This is a breaking change on a couple of levels (statistically speaking). I don't mind breaking stuff if it is really important. This isn't, and there is also a workaround (create a local version of the shortcode). We have to revisit this in the future (add image Resouce support etc.), but before breaking stuff, I think we have to figure out a better design for those internal shortcodes (pull them out into some external bundle, versioning etc.) |
What kind of breakage do you expect? Using the customized
I get: I have the whole caption in italics, so the italicized part doesn't stand out. There will still be subtle breakages if people have the stray But I don't see this as a widely breaking change.
I agree. |
Another case where this proposal will be useful: https://discourse.gohugo.io/t/html-in-shortcode-attribute-breaks-shortcode/11027 |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
@bep Can you please give another thought to this? Is this really that of a breaking change? Most people don't care of using Markdown in captions. So this change won't affect them in any way. On the other hand, this change will be a welcome change for folks wanting to use markup in captions.. and HTML allows |
@bep Thanks for re-opening this. Should I start working on a PR for the figure shortcode that basically runs (Basically same as the older PR https://github.com/gohugoio/hugo/pull/4405/files#diff-33eb7415b0f69c81e6da0d26eadeea41, but re-done in the new shortcode file location.) |
@bep Would you accept the PR for this.. awaiting your reply to the previous question. (This PR will enable Org mode/ox-hugo users have the figure captions rendered the right way, and I have heard of this request quite a few times.). While a custom figure shortcode can fix this, it would be nice to have Hugo do the right thing so that I don't have to ask everyone to use my custom shortcode just for this. HTML allows tags in captions, so Hugo should insert style tags corresponding to Markdown format too. I don't see this much of a breaking change. |
Yes. |
I am trying to test the change locally.. after go1.11, the old
Can you please help me with this? How do you run tests locally? |
ah.. commented that too soon.. need to set |
@bep PR submitted and it passes all the tests. Please review. Thanks! |
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. |
Hello,
It is often a necessity to allow emphasis in figure captions, especially for technical blogs, where you would use
`code`
markup for referring to file names, commands, etc.Here is a test Markdown content file where I have such caption:
image-captions-with-markdown.md
.But Hugo does not render the Markdown in captions, and so they show up like this:
Hugo generated page
I get the exact same behavior whether I use
{{< figure .. >}}
or{{% figure .. %}}
.Proposal 1
Here was my Proposal 1.
Note that that change did not fail any existing test.
Proposal 2
{{< .. >}}
or{{% .. %}}
was used? If so, we can do what I did in Proposal 1, but only if{{% figure .. %}}
style shortcode is used.The text was updated successfully, but these errors were encountered: