Posted by Write.app on 11/24/2012
Update! Write.app has swapped out it's original Markdown converter for a more modern one. Forget all the special Markdown rules this site used to enforce. You may now write Markdown like you're used to including GitHub flavored Markdown.
Write.app was created for, among others, coders so it's only natural for us to support code blocks. And we do! Along with automatic syntax hilighting. Here's how it works.
Inline code snippets
You can place code inline with body text
just like this. Here's how:
`Just put the code between back ticks`
Code blocks in Write.app work just a little differently than normal Markdown code blocks. Instead of enclosing your code in sets of 3 back ticks we use 3 tildes, like this:
Some code in a code block
Another option is to use indented code blocks instead. Just indent any line of text by 4 spaces or more and it will be parsed as a block of code.
Indented code blocks are unaffected by the live preview bug that is discussed below.
A note about code blocks and the editor
Even though code blocks need to be enclosed in tildes there is currently a bug in the editor that prevents the live preview from displaying properly. In the live preview pane you'll see the text within a code block shown inline. This is an editor bug and your code will display properly upon saving and reviewing. The reason for this is that the live preview pane uses a different Markdown parser than the one used everywhere else within the app. For technical reasons we are unable currently to use the same parser in both places. We are working on this and will update this when there is a fix. In the meantime, please know that your code blocks will work after saving and upon reviewing and in any public notes you publish.