0

Trying to submit a blog entry in Markdown. The entry includes a section displaying HTML syntax. However, when I try to include it in the markdown file, the HTML is getting rendered in the page itself.

How do I get it to just display the syntax without rendering?

This is what I'm trying now:

<pre class=" language-markup"><code class=" language-markup">
    <p>Blah</p>
</code>
</pre>
Ahmed Haque
  • 7,174
  • 6
  • 26
  • 33
  • you're going to have to use the entity characters – Daemedeor Sep 29 '15 at 03:24
  • also please look for your quesiton on SO first: http://stackoverflow.com/questions/2820453/display-html-code-in-html – Daemedeor Sep 29 '15 at 03:26
  • Thanks for the reply. I had already seen this answer but it hardly seems practical to convert every < and > with &lt and &gt. Also the answer was from 2010. And I'm trying their last option of wrapping things in
     and  tags but it doesnt seem to work. 
    
    Any other suggestions?
    – Ahmed Haque Sep 29 '15 at 06:15
  • If you put the HTML in a code block, the angle brackets will get converted for you. Any reason you can't just use a code block? – Waylan Sep 29 '15 at 20:09
  • @Waylan. Sorry, if I'm missing something, but isn't that what I'm doing already? – Ahmed Haque Sep 29 '15 at 20:17
  • 1
    I mean code blocks using Markdown syntax, not HTML... Indent the block by four spaces. See the [rules](http://daringfireball.net/projects/markdown/syntax#precode). – Waylan Sep 29 '15 at 20:30
  • Ah @Waylan. Yeah... I ended up doing that, but I wasn't able to take advantage of the syntax highlighting used on the site. Thanks for the input. At least I know that there wasn't something obvious I wasn't doing. – Ahmed Haque Sep 30 '15 at 21:33

0 Answers0