<!--more--> HTML in a code block breaks rendering

Hi!

I’ve got a post that has a code block, which includes the HTML-tag <!--more-->.
When Hugo renders the page, the entire code block is blank, unless I ‘break’ that tag.
The part of the code block that breaks on rendering is this:

$($_item.encoded.'#cdata-section' -replace "<[/]?code>","``````" -replace "<!--more-->","" -replace "<[/]?strong>","**" -replace "<[/]?em>","_" -replace '&gt;','>' -replace '&lt;','<')

How can I make sure that the code block is rendered properly?

I don’t know of any way around this. If the code block is for appearance only, you could try inserting a zero-width space, but anyone who wants to copy your code will not get what they want.

I think you can work around this by actually adding a <!--more--> “tag” near the top (after the intro, or at the top …)

1 Like

@bep thanks! That helps me work around the issue, indeed. :smiley:
A proper solution would be nice, though…