1

I had written a blog post in WordPress and checked its preview before publishing and noticed a strange format change in the HTML code I have added in my blog post, converting (encoding) the < and > characters into their (&lt) and (&gt).

Is there a plugin I can add for displaying the code as it is?

1

2 Answers 2

2

After a long research and help from my seniors, I got this solution for restricting the WordPress from converting (encoding) the < and > characters into their (&lt) and (&gt) equivalents:

You can use:

<pre class="lang:html decode:true ">
    /* Some HTML code here */
</pre>
Sign up to request clarification or add additional context in comments.

2 Comments

Why a space after "true"? Is it required?
Not compulsory @PeterMortensen
0

I replaced the < character with a special character , and the > character by just to prevent rendering my HTML code on my blog.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.