Why does Wordpress change even fewer characters than characters?

On my Wordpress blog, I use the wp-sytax plugin to format a piece of code.

In the HTML view, I have the following code:

<pre lang="c"> #include<stdio.h> </pre> 

But in normal mode, it shows:

 #include&lt;stdio.h&gt; 

How can I make #include<stdio.h> when I typed it?

+4
source share
2 answers

Add escaped="true" to tell the engine that the code should not be converted to objects:

 <pre lang="c" escaped="true"> #include<stdio.h> </pre> 

(See Example 4 Documentation )

+5
source

You need to modify the plugin a bit and output the characters as described in this post .

 //$geshi = new GeSHi($code, $language); $geshi = new GeSHi(htmlspecialchars_decode($code), $language); 

Escaping above is done using htmlspecialchars _decode.

0
source

Source: https://habr.com/ru/post/1389497/


All Articles