How to add code blocks in your posts
December 9th, 2006 at 11:28 am (Admin Blog)
Hi
I am going to give a guideline to the authors about including code blocks in their posts like code blocks of HTML.
If you want to fine-tune how treats your code, use the allow and lang attributes on the code tag to specify how Code Markup should handle it.
<strong><code /></strong>or<strong><code /></strong>allows common HTML tags to be rendered, and displays everything else exactly as written.attribute, separated by spaces. As a special case, you can include the
<li><code><strong><code /></strong>displays content exactly as written — no markup allowed.
<li><code><strong><code /></strong>renders content as HTML — all markup is allowed.
<li><code><strong><code /></strong>allows only <code /><em>, <code /><strong>and <code />tags to be rendered as HTML — everything else is displayed exactly as written. You can put whatever tags you like in the <code>allowcommenttag — this means that HTML comments<!-- like this -->will be “rendered” as normal HTML comments (i.e. not displayed).<code lang="html" /><strong><em>or
</em></strong><code lang="xhtml" /><strong><em>displays content exactly as written, the same as </em></strong><code /><strong><em>.</em></strong><strong><em>The <code>allowattribute overrides thelangattribute.Examples
Example: Test strings using
aString < "foo".
Display: Test strings usingaString < "foo".Example:
<pre><code lang="xhtml"><!-- paragraph --> What's going on?Display:
<!-- paragraph --> What's going on?Example:
<pre><code><!-- paragraph --> What's going on?Display:
<!-- paragraph --> What's going on?Example:
<pre><code> for (int i=0; i<5; ++i) { <span style="color: red">cout</span> < < "smap!" << endl; }Display:
for (int i=0; i<5; ++i) { <span style="color: red">cout</span> < < "smap!" << endl; }Example:
<pre><code> <a href="http://fastcreators.com/article/<span%20style=">target-url">Link text <p />Display: <pre class="code"><code><a href="http://fastcreators.com/article/<span%20style=">target-url">Link text</a>I thank Bennet for providing this awesome plugin.
Regards,
Haroon (www.fastcreators.com)









