It supports a subset of the original markdown syntax, in order to avoid XSS attack.
The following rules are listed in alphabetical order. To see the actual application order, read the definitions:
Code block with backquote
```
abc
```Code block with tilde
~~~
abc
~~~UNSAFE Code block with backquote
``` {.abc}
abc
```is tranlsated to
<pre><code class="abc">abc</code></pre>UNSAFE Code block with tilde
~~~ {.abc}
abc
~~~Code block with indent
____abcwhere _ is a space
Headers: e.g. # abc is for <h1> and ## abc is for <h2>. Similar rules are applied for <h3> to <h6>.
Header <h1> by underline
Title
===Header <h2> by underline
Sub-title
---Hr: e.g. ***
UNSAFE Image
 {.a .b}is translated to
<img alt="text" src="link" class="a b">Note that the class part is optional.
UNSAFE Div inline HTML
<div>
...
</div>Note that <div> and </div> should be their own lines.
UNSAFE Script inline HTML
<script>
...
</script>Unordered list
* a
* b
* cA list element can have block-level elements by adding line spaces.
* line1
* line2
* line3
* line4is translated to
<ul>
<li>
<p>line1</p>
<ul>
<li>line2</li>
<li>line3</li>
</ul>
</li>
<li>
<p>line4</p>
</li>
</ul>However, without a line space, a list element CANNOT include another list.
* line1
* line2
* line3is translated to
<ul>
<li>
<p>line1 <em> line2 </em> line3</p>
</li>
</ul>rather than something like
<ul>
<li>
line1
<ul>
<li>line2</li>
<li>line3</li>
</ul>
</li>
</ul>This is beacause, I am too lazy to think about such ambiguous corner cases. /o\
Ordered list
1. a
2. b
3. cParagraph
abc
defQuote
> abcBr: e.g. abc__<end-of-line>, where '_' is a space
Link: e.g. <https://kkeun.net>
For simplicity, the https:// prefix is omitted in the translated result, i.e. the example above is translated to
<a href="https://kkeun.net">kkeun.net</a>Note that the link address must start with https:// or http://.
UNSAFE Link: e.g. [kkeundotnet](https://kkeun.net)
Escaped character: HTML special characters, e.g. &, <, etc., are translated to &, <, etc. The following characters should be escaped by backslash in markdown.
[ ] \ ` * # _ { } ( ) + - . !Emphasis: e.g. *abc*
Strong: e.g. **abc**
Emphasis+strong: e.g. ***abc***
Note that nested forms of emphasis and strong are NOT supported. For example,
***word*word**will NOT be translated as you expect.
Strike: e.g. ~~abc~~
Code: e.g. `abc`
Hex unicode: e.g. &#xhhhhh;
Dec unicode: e.g. &#nnnnnn;
That's it. Enjoy kkmarkdown!