3 ms·
I wrote about the supported syntax here: https://collectednotes.com/blog/a-tour-of-the-markdown-syntax https://collectednotes.com/blog/a-tour-of-the-markdown-sy
by alecrosa 6y ago
I wrote about the supported syntax here: https://collectednotes.com/blog/a-tour-of-the-markdown-syntax https://collectednotes.com/blog/a-tour-of-the-markdown-synta...
I think one backtick is pre and three (with optional language is code with syntax highlighting)
- Stratoscope 6y agoMarkdown supports inline code with a single backtick on each side, and multiline code blocks with triple backticks above and below. Alternatively, a multiline code block can be indented four spaces. Let me see if I can illustrate. On HN, backticks are meaningless, and code blocks require two space indents, so this should render as you would write the Markdown source: Here would be `inline code` delimited with single backticks. It translates to <code>inline code</code>. Here would be a multiline code block. It typically translates to <pre><code>Code is here.</code></pre>: ``` Code is here. ``` A multiline code block can also have a language name when it uses triple backticks, as in your example: ```swift Swift code is here. ``` Note that there are many flavors of Markdown! I'm describing the one you appear to be using, which is similar to what's used on Stack Overflow and other Stack Exchange sites.
- tompagenet2 6y agoThanks very much. I'd not appreciated the flexibility of what is possible in terms of code display. Thanks for explaining and letting me understand a bit more!