package kkmarkdown
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHr
- BlockRuleImg
- BlockRuleInlineHTML
- BlockRuleInlineHTML
- BlockRuleList
- BlockRuleList
- BlockRuleP
- BlockRuleQuote
- RuleBr
- SpanRuleA
- SpanRuleA
- SpanRuleEscape
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleUnicode
- SpanRuleUnicode
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=cc8056af18a204bf68d60f50be5a9de7
sha512=452ef12429aa68606e79b82d883275abd05659fec52509dfa18d7de0edcfa0afba7fa9001d9643c5ad072a494ad8593c6f127e382b06d6c224964b3a7969f388
doc/syntax.html
kkmarkdown syntax
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:
BlockRuleCode
Code block with backquote
```
abc
```BlockRuleCode
Code block with tilde
~~~
abc
~~~BlockRuleCode
UNSAFE Code block with backquote
``` {.abc}
abc
```is tranlsated to
<pre><code class="abc">abc</code></pre>BlockRuleCode
UNSAFE Code block with tilde
~~~ {.abc}
abc
~~~BlockRuleCode
Code block with indent
____abcwhere _ is a space
BlockRuleHeader
Headers: e.g. # abc is for <h1> and ## abc is for <h2>. Similar rules are applied for <h3> to <h6>.
BlockRuleHeader
Header <h1> by underline
Title
===BlockRuleHeader
Header <h2> by underline
Sub-title
---BlockRuleHr
Hr: e.g. ***
BlockRuleImg
UNSAFE Image
 {.a .b}is translated to
<img alt="text" src="link" class="a b">Note that the class part is optional.
BlockRuleInlineHTML
UNSAFE Div inline HTML
<div>
...
</div>Note that <div> and </div> should be their own lines.
BlockRuleInlineHTML
UNSAFE Script inline HTML
<script>
...
</script>BlockRuleList
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\
BlockRuleList
Ordered list
1. a
2. b
3. cBlockRuleP
Paragraph
abc
defBlockRuleQuote
Quote
> abcRuleBr
Br: e.g. abc__<end-of-line>, where '_' is a space
SpanRuleA
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://.
SpanRuleA
UNSAFE Link: e.g. [kkeundotnet](https://kkeun.net)
SpanRuleEscape
Escaped character: HTML special characters, e.g. &, <, etc., are translated to &, <, etc. The following characters should be escaped by backslash in markdown.
[ ] \ ` * # _ { } ( ) + - . !SpanRuleStack
Emphasis: e.g. *abc*
SpanRuleStack
Strong: e.g. **abc**
SpanRuleStack
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.
SpanRuleStack
Strike: e.g. ~~abc~~
SpanRuleStack
Code: e.g. `abc`
SpanRuleUnicode
Hex unicode: e.g. &#xhhhhh;
SpanRuleUnicode
Dec unicode: e.g. &#nnnnnn;
That's it. Enjoy kkmarkdown!
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHr
- BlockRuleImg
- BlockRuleInlineHTML
- BlockRuleInlineHTML
- BlockRuleList
- BlockRuleList
- BlockRuleP
- BlockRuleQuote
- RuleBr
- SpanRuleA
- SpanRuleA
- SpanRuleEscape
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleUnicode
- SpanRuleUnicode