1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-18 14:10:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/wikitext/Code Blocks in WikiText.tid

45 lines
1.1 KiB
Plaintext
Raw Normal View History

created: 20131205160047557
2014-10-24 13:50:19 +00:00
modified: 20141024134125489
2014-09-11 08:15:58 +00:00
tags: WikiText
title: Code Blocks in WikiText
type: text/vnd.tiddlywiki
2014-09-11 08:15:58 +00:00
caption: Code Blocks
You can use triple backticks <code>&#96;&#96;&#96;</code> to mark code blocks:
<pre>
&#96;&#96;&#96;
This will be monospaced
&#96;&#96;&#96;
</pre>
Renders as:
```
This will be monospaced
```
2014-10-24 13:50:19 +00:00
To be interpreted correctly, the three backticks need to be at the start of the line and immediately followed by a line-break.
Be aware that any preceding paragraph content should be properly terminated with a double line break, too. So, this example is wrong:
<pre>
This is an ordinary paragraph
&#96;&#96;&#96;
This will be monospaced
&#96;&#96;&#96;
</pre>
The correct version is:
<pre>
This is an ordinary paragraph
&#96;&#96;&#96;
This will be monospaced
&#96;&#96;&#96;
</pre>
2014-02-14 19:28:44 +00:00
Note that some keyboard layouts treat the backtick as a [[dead key|http://en.wikipedia.org/wiki/Dead_key]], making it hard to type. The trick is to type three backticks followed by a space. Alternatively, type all six backticks in one go, then a space, and then move the cursor back three characters to type or paste the content.