Monday, April 23, 2012

Delimiting code within a line in Markdown

I love the simple way that Markdown parses code blocks - just indent with 4 spaces (or 2 tabs). In a previous update, I added a button to WikiPack’s web Markdown editor for automating the process of working with code blocks, but it didn’t act on snippets of code within a regular line of text.

Delimiting code snippets

To insert a code snippet within a line of regular Markdown text, you just wrap it in “backticks” like so:

I strongly recommend against using any `<blink>` tags.

I wish SmartyPants used named entities like `&mdash;`
instead of decimal-encoded entites like `&#8212;`.

This is especially useful for displaying HTML tags and character entities within a Markdown document, as without delimiting them they will actually be parsed and rendered as HTML.

~~~

Checkout WikiPack’s awesome web Markdown editor with optional Dropbox sync at http://WikiPackIt.com.

No comments:

Post a Comment