git-svn-id: https://plugins.svn.wordpress.org/prismatic/trunk@1521326 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Jeff Starr 2016-10-24 18:38:40 +00:00
parent 2ede75bac4
commit 445d89b521

View File

@ -132,13 +132,13 @@ Once the settings are configured, you can enable syntax highlighting for any cod
* Wrap multi-line code with pre & code tags: <pre><code>...</code></pre> * Wrap multi-line code with pre & code tags: <pre><code>...</code></pre>
* Wrap single-line code with code tags: <code>...</code> * Wrap single-line code with code tags: <code>...</code>
Note: Prism.js highlights both multi-line and single-line code snippets. Highlight.js only supports multi-line code snippets. __Note:__ Prism.js highlights both multi-line and single-line code snippets. Highlight.js only supports multi-line code snippets.
With the proper markup in place, you can indicate a specific language by adding a class of language-*** or lang-*** to the <code> tag (where *** is the language identifier). For example, to indicate PHP as the language for a single-line code snippet: With the proper markup in place, you can indicate a specific language by adding a class of language-*** or lang-*** to the <code> tag (where *** is the language identifier). For example, to indicate PHP as the language for a single-line code snippet:
<code class="language-php"><?php echo 'Hello world'; ?></code> <code class="language-php"><?php echo 'Hello world'; ?></code>
Likewise, to indicate HTML as the language for a multi-line code snippet (note: if you are reading this plugin's raw readme.txt file, [click here](https://wordpress.org/plugins/prismatic/installation/) to read the formatted text): Likewise, to indicate HTML as the language for a multi-line code snippet:
<pre><code class="language-html"> <pre><code class="language-html">
<table> <table>
@ -172,23 +172,25 @@ Just like Prism.js and Highlight.js, the Prismatic plugin follows HTML coding st
For example, the code snippets included in either of the following markup examples would be escaped: For example, the code snippets included in either of the following markup examples would be escaped:
This is a single-line example, &lt;code&gt;&lt;?php echo 'Hello world'; ?&gt;&lt;/code&gt;. This is a single-line example:
This is a multi-line code example (note: if you are reading this plugin's raw readme.txt file, [click here](https://wordpress.org/plugins/prismatic/installation/) to read the formatted text): <code class="language-php"><?php echo 'Hello world'; ?></code>.
This is a multi-line code example:
&lt;pre&gt;&lt;code&gt;<br> <pre><code class="language-html">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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p;&lt;/table&gt;<br> </table>
&lt;/code&gt;&lt;/pre&gt; </code></pre>
So what exactly happens when the "Code Escaping" options are enabled? Here is a summary that applies to each section (post content, excerpts, and comments): So what exactly happens when the "Code Escaping" options are enabled? Here is a summary that applies to each section (post content, excerpts, and comments):