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

Shortcodes do not get evaluated in HTML content files with manual summary splitting #6513

Closed
danmharris opened this issue Nov 19, 2019 · 9 comments

Comments

@danmharris
Copy link

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

$ hugo version
Hugo Static Site Generator v0.58.3 linux/amd64 BuildDate: 2019-09-20T07:23:07Z

Does this issue reproduce with the latest release?

Yes

Issue Details

When rendering an HTML content files which uses manual summary splitting shortcodes do not get evaluated and instead get displayed as raw text. This does not occur when using automatic summary splitting or manual summary splitting in markdown files.

I've produced a reproduction of this issue at https://github.com/danmharris/hugo-html-bug-demo. This contains two files, posts/withsplit.html and posts/nosplit.html which use manual and automatic splitting respectively.

When visiting /posts/nosplit the content renders as expected:
image

However when visiting /posts/withsplit, the shortcode is not evaluated:
image

@bep bep added the Bug label Nov 19, 2019
@bep bep added this to the v0.60 milestone Nov 19, 2019
@jonisbell
Copy link

Maybe this is related to the second part of #6451 because it happens under very similar conditions.

@bep bep modified the milestones: v0.60, v0.61, v0.62 Nov 25, 2019
@bep bep modified the milestones: v0.62, v0.63 Dec 11, 2019
@Dieterbe
Copy link

Dieterbe commented Dec 30, 2019

I can confirm this.
This breaks all my syntax highlighting because I have html posts with manual <!--more--> markers

Here's how you can reproduce with latest master:

mkdir hugo-test
cd hugo-test
hugo new site quickstart && cd quickstart
mkdir themes && cd themes && git clone https://github.com/yanlinlin82/simple-style.git && cd ..
echo 'theme = "simple-style"' >> config.toml
mkdir content/post
cat <<EOF > content/post/mdpost.md
---
title: "Mdpost"
date: 2019-12-30T15:21:57+01:00
draft: false
---
summary
<!--more-->
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF
cat <<EOF > content/post/htmlpost.html
---
title: "HTMLpost"
date: 2019-12-30T15:21:57+01:00
draft: false
---
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF
cat <<EOF > content/post/htmlpostwithsummary.html
---
title: "HTMLpost with summary"
date: 2019-12-30T15:21:57+01:00
draft: false
---
summary
<!--more-->
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF

"HTMLpost with summary" does not render properly (all the highlight commands and code are shown as is), whereas the other two work fine

@bep bep modified the milestones: v0.63, v0.64 Jan 22, 2020
@bep bep modified the milestones: v0.64, v0.65 Jan 30, 2020
@bep bep modified the milestones: v0.65, v0.66 Feb 18, 2020
@bep bep modified the milestones: v0.66, v0.67 Mar 2, 2020
@bep bep modified the milestones: v0.67, v0.68 Mar 9, 2020
@bep bep modified the milestones: v0.68, v0.69 Mar 20, 2020
@bep bep modified the milestones: v0.69, v0.70 Apr 8, 2020
@bep bep modified the milestones: v0.70, v0.71 Apr 28, 2020
@bep bep modified the milestones: v0.71, v0.72 May 18, 2020
@bep bep modified the milestones: v0.72, v0.73 May 31, 2020
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@Dieterbe
Copy link

Dieterbe commented Feb 16, 2024

updating reproduction steps for the latest quickstart instructions using hugo 0.122, to confirm that still "HTMLpost with summary" does not render properly (all the highlight commands and code are shown as is), whereas the other two work fine

you can execute all the code below in a terminal in a temp directory:

hugo new site quickstart && cd quickstart
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
mkdir -p content/posts
cat <<EOF > content/posts/mdpost.md
---
title: "Mdpost"
date: 2019-12-30T15:21:57+01:00
draft: false
---
summary
<!--more-->
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF
cat <<EOF > content/posts/htmlpost.html
---
title: "HTMLpost"
date: 2019-12-30T15:21:57+01:00
draft: false
---
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF
cat <<EOF > content/posts/htmlpostwithsummary.html
---
title: "HTMLpost with summary"
date: 2019-12-30T15:21:57+01:00
draft: false
---
summary
<!--more-->
content
{{< highlight bash "style=default" >}}
echo $hostname
{{< / highlight >}}
end.
EOF
hugo server

@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
@bep bep modified the milestones: v0.129.0, v0.131.0 Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 2024
@jmooring
Copy link
Member

This was resolved in v0.123.0.

@Dieterbe
Copy link

indeed! thank you

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

Successfully merging a pull request may close this issue.

7 participants