Skip to content

WordPress Code Block &lt Problem

  • by

The WordPress code block &lt problem is the problem about the less than sign (<) and the greater than sign (>) being rendered into &lt and &gt, respectively.

The problem is illustrated by Figures 1 and 2. Figure 1 shows the program source code as it appears on the WordPress code block. The page preview is shown in Figure 2. As can be seen, the line “#include <SoftwareSerial.h>” becomes “#include &lt;SoftwareSerial.h&gt;”. That is, the less than sign (<) is replaced by “&lt” and the greater than sign becomes “&gt”.

Screenshot of the code block showing the WordPress Code Block &lt Problem
Figure 1. Source Code on the WordPress Code Block

Screenshot of the page preview depicting the WordPress Code Block &lt Problem
Figure 2. WordPress Page Preview of the Source Code Page

As it turns out, the problem is caused by the crayon-syntax-highlighter plugin. Fortunately, there is a simple fix for the problem.

Screenshot of the crayon-syntax-highlighter settings that can solve the WordPress Code Block &lt Problem
Figure 3. crayon-syntax-highlighter Settings

Go to WordPress Settings/Crayon. Under the Code settings, check the item “Decode HTML entities in code”. Please refer to Figure 3.

Screenshot of how to save the changes on crayon-syntax-highlighter to fix the WordPress Code Block &lt Problem
Figure 4. crayon-syntax-highlighter Save Changes

Then, go to the bottom of the settings page and click on the Save Changes button, as shown in Figure 4. Then after a new page preview, you should get a properly rendered source code page.

Picture of the preview page of the with the WordPress Code Block &lt Problem solved
Figure 5. Page Preview of the Fixed Source Code Problem

References on WordPress Code Block &lt Problem

WordPress

crayon-syntax-highlighter

Leave a Reply

Your email address will not be published. Required fields are marked *