|
|
@@ -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 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: |
|
|
|
|
|
|
|
<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"> |
|
|
|
<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: |
|
|
|
|
|
|
|
This is a single-line example, <code><?php echo 'Hello world'; ?></code>. |
|
|
|
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: |
|
|
|
|
|
|
|
<pre><code><br> |
|
|
|
<table><br> |
|
|
|
<tr><br> |
|
|
|
<th>Name</th><br> |
|
|
|
<th>Side</th><br> |
|
|
|
<th>Role</th><br> |
|
|
|
<tr><br> |
|
|
|
<td>Darth</td><br> |
|
|
|
<td>Dark</td><br> |
|
|
|
<td>Sith</td><br> |
|
|
|
</tr><br> |
|
|
|
</table><br> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="language-html"> |
|
|
|
<table> |
|
|
|
<tr> |
|
|
|
<th>Name</th> |
|
|
|
<th>Side</th> |
|
|
|
<th>Role</th> |
|
|
|
<tr> |
|
|
|
<td>Darth</td> |
|
|
|
<td>Dark</td> |
|
|
|
<td>Sith</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</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): |
|
|
|
|
|
|
|