views:

246

answers:

2

Markdown syntax is often convenient to write blogs and comments;

But at times it interferes with the content when you would want to write a simple html

Is there a tag / syntax that asks markdown to ignore that part like the pre html tag?

If pre works, what if the markdown part needs to include an html tag?

+1  A: 

At least here on Stack Overflow, the ... <pre> HTML tag works just fine for that purpose. It also formats your text like a browser would:

This is pre-formatted, so in here I can /slash/ and *star* stuff
without issues, and [[square brackets]] [are] just brackets.
unwind
Also, use backticsk (`) for shorter snippets inside larger formatted areas.
Joel Coehoorn
+2  A: 

The original implementation of Markdown (by Gruber) and PHP Markdown don't format inside block-level HTML elements, so you can use <div>, for example:

Markdown text.

More markdown text.

<div>
Markdown ignores inside the div, you can do all sorts of crazy stuff:
<a href="http://www.stackoverflow.com"&gt;Stack Overflow</a>.
<blink>Is blink still supported?</blink>
</div>

Yet more markdown text.

Will get rendered as:

<p>Markdown text.</p>

<p>More markdown text.</p>

<div>
Markdown ignores inside the div, you can do all sorts of crazy stuff:
<a href="http://www.stackoverflow.com"&gt;Stack Overflow</a>.
<blink>Is blink still supported?</blink>
</div>

<p>Yet more markdown text.</p>
Can Berk Güder
Nope, It does. Just verified
Lakshman Prasad
Which implementation are you using?
Can Berk Güder
I updated the first paragraph.
Can Berk Güder
Tested with both Markdown.pl and PHP Markdown, btw.
Can Berk Güder
Yup, Actually works. Thanks! doesnt perhaps work when the <div> is enclosed within a <code>
Lakshman Prasad