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

Open
danmharris opened this issue Nov 19, 2019 · 6 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 added this to the v0.112.0 milestone Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@artch
Copy link

artch commented Nov 24, 2023

I can confirm that this is still an issue in 0.120.4 for .html content files.

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

Successfully merging a pull request may close this issue.

7 participants