WordPress Plugin for Escaping Markup for Prism Syntax Highlighter

Just a small announcement that a WordPress plugin has been committed for Prism Syntax Highlighter. I liked the plugin as it is really lightweight and fast.

The new plugin will allow you to post markup without manually changing the code to post online. What is required is just installation and nothing. Yes, nothing at the time of posting. If you use text mode of Editor in plugin then nothing need to be done. If you like Visual Mode then just paste your code in Text Mode of WordPress Editor and, press Draft to go back to Visual Mode. If Auto Save happens then also the markup will be transferred to escaped code that will look exactly you posted in WordPress.

The Plugin Effect:

The Markup Entered in Text Mode:


The effect of WordPress Plugin “Escape HTML For Prism Syntax Highlighter” on code:


I am using Syntax Highlighter based Alex Gorbatchev. I got this through WordPress plugin. It is using Alex’s Syntax Highlighter Version 1.5. Now, Version 3.1 is available.

Problem in shifting to newer version of Alex’s tool is that I am using different syntax to highlight code. My syntax of code is <pre title="code" class="html"></pre>. Now it needs in this way: <pre class="brush: js">. For this to use or any plugin, I need to change all old post. Though task!

For prism, I am thinking of doing something. I need to write a script which takes old post data and replace all <pre class="xxxx"> to <pre><code class="language-xxxx"> and <code></pre> to </code></pre>. Lets see when I would do that. Once done I may update it here so that it may help others to tweak and use that for other syntax highlighter.

  • # 1 - by Franziska

    Great post. I was checking constantly this blog and I am
    impressed! Extremely useful info particularly the closing phase
    🙂 I maintain such information much. I was looking for this certain information for a very lengthy time.
    Thanks and best of luck.

Comments are open for an year period. Please, write here on Facebook page.