How to Tell Hugo Not to Parse HTML

Hongtao Hao / 2020-11-02

I found the solution here by Hissatsu . You can use encode convert XML to US-ASCII.

For example:

<p>I do not want to show this content.</p>

If you encode multiple lines of code, you’ll find that the output will become only one line. You solve the problem by adding </br> at the end of each line except the last line.

For example, if I want the output to be this:

{{< block class="note" >}}
This is a note.
{{< end >}}

I’ll use this:

{{&lt;  block class=&quot;note&quot;  &gt;}} </br>
This is a note. </br>
{{&lt; end &gt;}}

Last modified on 2020-11-29