obsidian-sandbox-vault/Formatting/Code block.md

24 lines
671 B
Markdown
Raw Permalink Normal View History

2023-11-10 05:41:54 +00:00
Syntax highlight is supported with the language specified after the first set of backticks. We use prismjs for syntax highlighting, a list of supported languages can be found [at their site](https://prismjs.com/#supported-languages)
<pre><code>```js
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
```</code></pre>
```js
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
```
```md
Text indented with a tab is formatted like this, and will also look like a code block in preview.
```
Text indented with a tab is formatted like this, and will also look like a code block in preview.