hixhix
1
I have two shorts code, one is details
defined as below
<details>
<summary>{{ .Get "title" | default "Spoiler" | markdownify }}</summary>
<div>{{ .Inner | markdownify }}</div>
</details>
and the other is sub
<sub>{{ .Get 0 | markdownify }}</sub>
And this is how I tried to use
{{<details>}}
a{{<sup "1">}}
{{</details>}}
The child shortcode doesn’t take effect. Why idea how I can get this to work? Thanks.
View source in your browser, typically Ctrl +U. You will see this comment instead of the opening and closing sub
tags:
<!-- raw HTML omitted -->
See https://gohugo.io/getting-started/configuration-markup/#rendererunsafe. You need to do this in your site configuration:
[markup.goldmark.renderer]
unsafe = true
It’s not unsafe if you control the content.
But you don’t need subscript or superscript shortcodes:
https://gohugo.io/getting-started/configuration-markup/#extras
In your site configuration:
[markup.goldmark.extensions.extras.subscript]
enable = true
[markup.goldmark.extensions.extras.superscript]
enable = true
Then in your markdown:
Subscript H~2~O
Superscript 1^st^
hixhix
3
Thank you so much, both work for me.
system
Closed
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.