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

Use angle bracket delimited shortcodes to fix h2 anchors #9

Merged
merged 1 commit into from
Sep 19, 2020

Conversation

klingtnet
Copy link
Member

Since hugo 0.55 percent sign delimited shortcodes were interpreted as
markdown which caused our <h2> headings to be dropped silently.

To get the old behavior you can either prepend your shortcode template
with

{{ $_hugo_config := `{ "version": 1 }` }}

or use the {{< my-shortcode > }} format. The latter one is explicit
and thus clearer. (Details)

It boggles my mind that they introduced a breaking
change like this and then also allowed to override the behavior of one
format, now it is unclear how a short code is handled until you know
its template definition.

Since [hugo 0.55][1] percent sign delimited shortcodes were interpreted as
markdown which caused our `<h2>` headings to be dropped silently.

To get the old behavior you can either prepend your shortcode template
with

```
{{ $_hugo_config := `{ "version": 1 }` }}
```

or use the `{{< my-shortcode > }}` format.  The latter one is explicit
and thus clearer. ([Details][2])

It boggles my mind that they introduced a breaking
change like this and then also allowed to override the behavior of one
format, now it is unclear how a short code is handled until you know
its template definition.

[1]: gohugoio/hugo#5763
[2]: https://gohugo.io/content-management/shortcodes/#shortcodes-with-markdown
@miku
Copy link
Member

miku commented Sep 19, 2020

thanks for digging into this - indeed an unpleasant issue

@miku miku merged commit ee60c7c into source Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants