package kkmarkdown
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleCode
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHeader
- BlockRuleHr
- BlockRuleImg
- BlockRuleInlineHTML
- BlockRuleInlineHTML
- BlockRuleList
- BlockRuleList
- BlockRuleList
- BlockRuleList
- BlockRuleP
- BlockRuleQuote
- RuleBr
- SpanRuleA
- SpanRuleA
- SpanRuleEscape
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleUnicode
- SpanRuleUnicode
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=a20517d95590d03ff5b7670323b8b0dd
sha512=97b3faa09e23ab88c5b4dcabe88f29e5c675b6bb4b0c9230ec105a70b01b37b54274cc0ab4a5eed84a754a99e3664e116a7aba6c9697e3669229985f1bf749be
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, i.e. four spaces as indentation.
\tabcOr a tab can be used as indentation instead.
BlockRuleHeader
Headers: e.g. # abc is for <h1> and ## abc is for <h2>. Similar rules are applied for <h3> to <h6>. Optionally, trailing sharps are acceptable, i.e. # abc #.
BlockRuleHeader
Header <h1> by underline
Title
===BlockRuleHeader
Header <h2> by underline
Sub-title
---BlockRuleHr
Hr: e.g. ***, * * *, or ---
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
Similar to Lib.BlockRuleList.UlStar, but with '+' prefix.
BlockRuleList
Similar to Lib.BlockRuleList.UlStar, but with '-' prefix.
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* or _abc_
SpanRuleStack
Strong: e.g. **abc** or __abc__
SpanRuleStack
Emphasis+strong: e.g. ***abc*** or ___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
- BlockRuleList
- BlockRuleList
- BlockRuleP
- BlockRuleQuote
- RuleBr
- SpanRuleA
- SpanRuleA
- SpanRuleEscape
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleStack
- SpanRuleUnicode
- SpanRuleUnicode