Hmmarkdown is a HTML-aware Markdown parser and renderer. Hmmarkdown is as fast as everything else. If you need faster stop using JavaScript.
- Opinionated; limited syntax support
- Unforgiving; no affordance for errors
- Unstable; refactored on a whim
- Accepts a
string
or stream (e.g.Response.body
) - Processes some HTML-in-Markdown and Markdown-in-HTML
- Asynchronous architecture
Hmmarkdown is under active development. It is not stable or "production ready" β although I am testing in production (on my website).
Only the following Markdown syntax is supported for now because it's all I need. If you need alternate or additional syntax use another Markdown library.
> This is a blockquote.
> Blockquotes can have multiple lines.
> <cite>[Some name](https://example.com)</cite>
Lines must start with a >
greater-than sign followed by a single space.
Consecutive lines form new paragraphs within the same blockquote
.
# Heading level one
## Level two
### Level three
#### Level four
##### Level five
###### Level six
Line must start with 1β6 #
hash characters followed by a single space before the heading.
* * *
Any three asterisks, hyphens, or underscores will render a <hr>
element.
Spaces between characters are optional. Spaces around characters are not allowed.


β URL spaces and parentheses must be URL encoded.
Alternate text cannot include square brackets ([
or ]
).
<img alt="" src="https://example.com/image.jpg">
HTML image tags are passed through the same renderer and filter.
* List item one
Indented second line
* List item two
* List item three
New lines within an item are indented with exactly four spaces.
1. List item one
Indented second line
2. List item two
3. List item three
This will become a paragraph.
<div>
This will also become a paragraph.
</div>
Plain text is wrapped in <p>
paragraph tags.
```html
<h1>Hello, World!</h1>
```
Exactly three backticks followed by an optional language name.
[example link](https://example.com/slug%20%28parentheses%29/)
URL spaces and parentheses must be URI encoded.
Text between `backticks` is wrapped in `<code>`.
Text between ~~double tilde~~ is wrapped in `<del>`.
Text between *single asterisk* is wrapped in `<em>`.
Text between **double asterisk** is wrapped in `<strong>`.
Text content within a subset of HTML tags will have inline Markdown parsed.
<p>These words **are strong**.</p>
Will render:
<p>These words <strong>are strong</strong>.</p>
Inline Markdown with HTML inside is not parsed.
These words **<span>are not strong</span>**.
Will render:
<p>These words **<span>are not strong</span>**.</p>
Void elements and a subset of elements like iframe
and video
are left untouched and text content within is not parsed.
Nested Markdown blocks are not supported, e.g. lists in blockquotes, lists in lists, etc.
Documentation coming soon (maybe lol).
MIT License | Copyright Β© 2024 David Bushell