Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/.shards.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 1.0
shards:
markd:
git: https://github.com/icyleaf/markd.git
version: 0.4.2+git.commit.5e5a75d13bfdc615f04cc7ab166ee279b3b996d3
version: 0.5.0
reply:
git: https://github.com/i3oris/reply.git
version: 0.3.1+git.commit.90a7eb5a76048884d5d56bf6b9369f1e67fdbcd7
28 changes: 17 additions & 11 deletions lib/markd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- GFM support

## [0.5.0] (2022-06-14)

- Support CommonMark 0.29 #[50](https://github.com/icyleaf/markd/pull/50) thanks @[HertzDevil](https://github.com/HertzDevil).
- Fix typos #[47](https://github.com/icyleaf/markd/pull/47) #[49](https://github.com/icyleaf/markd/pull/49) thanks @[kianmeng](https://github.com/kianmeng), @[jsoref](https://github.com/jsoref).

## [0.4.2] (2021-10-19)

### Added
Expand Down Expand Up @@ -60,23 +65,24 @@ No changelog.

## [0.1.2] (2019-08-26)

- Use Crystal v0.31.0 as default complier.
- Use Crystal v0.31.0 as default compiler.

## [0.1.1] (2017-12-26)

- Minor refactoring and improving speed. thanks @[straight-shoota](https://github.com/straight-shoota).
- Use Crystal v0.24.1 as default complier.
- Use Crystal v0.24.1 as default compiler.

## 0.1.0 (2017-09-22)

- [initial implementation](https://github.com/icyleaf/markd/milestone/1?closed=1)

[Unreleased]: https://github.com/icyleaf/markd/compare/v0.4.2...HEAD
[0.4.2]: https://github.com/icyleaf/halite/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/icyleaf/halite/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/icyleaf/halite/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/icyleaf/halite/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/icyleaf/halite/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/icyleaf/halite/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/icyleaf/halite/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/icyleaf/halite/compare/v0.1.0...v0.1.1
[Unreleased]: https://github.com/icyleaf/markd/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/icyleaf/markd/compare/v0.4.2...v0.5.0
[0.4.2]: https://github.com/icyleaf/markd/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/icyleaf/markd/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/icyleaf/markd/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/icyleaf/markd/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/icyleaf/markd/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/icyleaf/markd/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/icyleaf/markd/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/icyleaf/markd/compare/v0.1.0...v0.1.1
25 changes: 12 additions & 13 deletions lib/markd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
[![Tag](https://img.shields.io/github/tag/icyleaf/markd.svg)](https://github.com/icyleaf/markd/blob/master/CHANGELOG.md)
[![Build Status](https://img.shields.io/circleci/project/github/icyleaf/markd/master.svg?style=flat)](https://circleci.com/gh/icyleaf/markd)

Yet another markdown parser built for speed, written in [Crystal](https://crystal-lang.org), Compliant to [CommonMark](http://spec.commonmark.org) specification (`v0.27`). Copy from [commonmark.js](https://github.com/jgm/commonmark.js).

**THIS PROJECT IS LOOKING FOR MAINTAINER**

Unfortunately, the maintainer no longer has the time and/or resources to work on markd further. This means that bugs will not be fixed and features will not be added unless someone else does so.

If you're interested in fixing up markd, please [file an issue](https://github.com/icyleaf/markd/issues/new) let me know.

<hr />

Yet another markdown parser built for speed, written in [Crystal](https://crystal-lang.org), Compliant to [CommonMark](http://spec.commonmark.org) specification (`v0.29`). Copy from [commonmark.js](https://github.com/jgm/commonmark.js).

## Installation

Expand Down Expand Up @@ -73,25 +82,15 @@ html = renderer.render(document)

## Performance

First of all, Markd is slower than [Crystal Built-in Markdown](https://crystal-lang.org/api/0.23.0/Markdown.html) which it is a lite version, only apply for generte Cystal documents ([#4496](https://github.com/crystal-lang/crystal/pull/4496), [#4613](https://github.com/crystal-lang/crystal/issues/4613)).

Here is the result of [a sample markdown file](benchmarks/source.md) parse at MacBook Pro Retina 2015 (2.2 GHz):

```
Crystal Markdown 3.28k (305.29µs) (± 0.92%) fastest
Markd 305.36 ( 3.27ms) (± 5.52%) 10.73× slower
Crystal Markdown (no longer present) 3.28k (305.29µs) (± 0.92%) fastest
Markd 305.36 ( 3.27ms) (± 5.52%) 10.73× slower
```

Recently, I'm working to compare the other popular commonmark parser, the code is stored in [benchmarks](/benchmarks).

## Donate

Markd is an open source, collaboratively funded project. If you run a business and are using Markd in a revenue-generating product,
it would make business sense to sponsor Markd development. Individual users are also welcome to make a one time donation
if Markd has helped you in your work or personal projects.

You can donate via [Paypal](https://www.paypal.me/icyleaf/5).

## How to Contribute

Your contributions are always welcome! Please submit a pull request or create an issue to add a new question, bug or feature to the list.
Expand Down
2 changes: 1 addition & 1 deletion lib/markd/shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: markd
version: 0.4.2
version: 0.5.0

authors:
- icyleaf <icyleaf.cn@gmail.com>
Expand Down
72 changes: 70 additions & 2 deletions lib/markd/spec/fixtures/regression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ bar</li>
Type 7 HTML block followed by whitespace (#98).

```````````````````````````````` example
<a>
<a>
x
.
<a>
<a>
x
````````````````````````````````

Expand Down Expand Up @@ -79,3 +79,71 @@ Issue jgm/CommonMark#468 - backslash at end of link definition
.
<p>[]: test</p>
````````````````````````````````

Issue jgm/commonmark.js#121 - punctuation set different

```````````````````````````````` example
^_test_
.
<p>^<em>test</em></p>
````````````````````````````````

Issue #116 - tabs before and after ATX closing heading
```````````````````````````````` example
# foo→#→
.
<h1>foo</h1>
````````````````````````````````

commonmark/CommonMark#493 - escaped space not allowed in link destination.

```````````````````````````````` example
[link](a\ b)
.
<p>[link](a\ b)</p>
````````````````````````````````

Issue #527 - meta tags in inline contexts

```````````````````````````````` example
City:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City">
<meta itemprop="name" content="Springfield">
</span>
.
<p>City:
<span itemprop="contentLocation" itemscope itemtype="https://schema.org/City">
<meta itemprop="name" content="Springfield">
</span></p>
````````````````````````````````

Double-encoding.

```````````````````````````````` example
[XSS](javascript&amp;colon;alert%28&#039;XSS&#039;%29)
.
<p><a href="javascript&amp;colon;alert('XSS')">XSS</a></p>
````````````````````````````````

Issue commonamrk#517 - script, pre, style close tag without
opener.

```````````````````````````````` example
</script>

</pre>

</style>
.
</script>
</pre>
</style>
````````````````````````````````

Issue #289.

```````````````````````````````` example
[a](<b) c>
.
<p>[a](&lt;b) c&gt;</p>
````````````````````````````````
Loading