Zola 12 Issue with continue-reading

Zola 12 issues with continue-reading

I’ve observed some issues with continue-reading in Zola 12. This time it’s with template output, it looks the same as the issues with the RSS output I noted earlier.

markdown

+++

### Get The Mega Bundle **Every Podcast Bundle Episode** All In One Easy Download 

{{ icon(fileName="paperplane",optImgClass="is-pulled-left is-64x64") }}

Do you just want it all? Then why not pay a little more and you will get a **MEGA bundle** of hundreds of brilliant English lessons with **free upgrades** as they become available.
<!-- more -->
It's a massive back catalogue of English podcast lessons we call the **MEGA Bundle**

Click on the `red BUY NOW button` and you could be improving your English fluency **today.**

....

Note the the summary text delineated by <!-- more →

The template

				<div>		  
				  {{ post.summary  | safe }}
				</div>

Simple, just pulls the post.summary

Rendered output (Chrome)

The output looks ok (browser is ignoring broken tags)

Zola 11 HTML Output

<p>Do you just want it all? Then why not pay a little more and you will get a <strong>MEGA bundle</strong> of hundreds of brilliant English lessons with <strong>free upgrades</strong> as they become available.</p>

Works fine.

Zola 12 HTML Output

<p>Do you just want it all? Then why not pay a little more and you will get a <strong>MEGA bundle</strong> of hundreds of brilliant English lessons with <strong>free upgrades</strong> as they become available.</p>
<span id="continue-reading"></span>
<p>It's a massive ba

Contains html from beyond the post.summary, which is truncated

Observations

  • A new unnecessary span with the ID is included (It should be harmless unless the ID conflicts)
  • The rendered output of post.summary now includes truncated HTML beyond that specified in the markdown using

The likely cause: https://github.com/getzola/zola/pull/941

@SgtIria can you make a small reproduction? I cannot reproduce with your example locally.

Zola V12+13

The problem: Continue-reading text appearing in content.summary output.

After a lot of trial an error testing, we think we’ve narrowed it down to being a problem with markdown content that has a shortcode before the <!-- more -->

Markdown that works fine:

# Title 
Some text. 
<!-- more -->
Some more text...

Markdown that results in an injection of continue-reading HTML:

# Title 
Some text. 
{{ quote(body="Nothing is impossible. The word itself says - I'm Possible" author="Audrey Hepburn")}}
(Optional text here or not results in the same issue)
<!-- more -->
Some more text...

The page.summary output for this has <span id="continue-readi included right at the end of the output, its truncated, the <span> is not closed.

Observation

The spurious text generated seems to be dependent upon the type of shortcode being used. If we use a shortcode for displaying an image we would get a different type of corruption/HTML inserted in the page.summary being displayed.

Thanks for narrowing it down! I think this is the last major bug to be fixed for 0.12.1 (https://github.com/getzola/zola/issues/1168)

I think https://github.com/getzola/zola/pull/1181 might fix it but i’ll add a test tomorrow.

I’ve added a test for that in https://github.com/getzola/zola/pull/1181/commits/bbaefdf93fa92107eb0ee136747bf505caf0e1cc and it seems to work @SgtIria
Can you clone it and verify? Let me know if you need help with the git/cargo commands

Ok, I rebuilt zola for windows V13 using PR 1181.

C:\Users\Iria\Zola\zola (zola-pr-1175 -> origin)
λ git fetch origin pull/1181/head:zola-pr-1181
remote: Enumerating objects: 60, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 88 (delta 52), reused 60 (delta 52), pack-reused 28
Unpacking objects: 100% (88/88), done.
From https://github.com/getzola/zola
 * [new ref]         refs/pull/1181/head -> zola-pr-1181

C:\Users\Iria\Zola\zola (zola-pr-1175 -> origin)
λ git branch
  master
* zola-pr-1175
  zola-pr-1181

C:\Users\Iria\Zola\zola (zola-pr-1175 -> origin)
λ git checkout zola-pr-1181
Switched to branch 'zola-pr-1181'
   ...
   Compiling site v0.1.0 (C:\Users\Iria\Zola\zola\components\site)
   Finished release [optimized] target(s) in 8m 42s

I then rebuilt our site using V11 and this V13 of Zola. I then diff (Meld GUI) them to check for changes. They generated nearly exactly the same outputs for rss feeds.

We will run some more testing tomorrow, but it looks good at this point :slight_smile:

1 Like