NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3553 most downloaded on crates.io
A 100% CommonMark-compatible GitHub Flavored Markdown parser and formatter
Latest stable
0.59.0
Last release 27 days ago
26 Oct 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
10 years old
105 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Two Comrak releases in one day? You must be lucky!
Two Comrak releases in one day? You must be lucky!
New APIs:
wikilinks_ignore_embeds, to disable parsing embed-type wikilinks. (by @kivikakk in https://github.com/kivikakk/comrak/pull/887)Diff: https://github.com/kivikakk/comrak/compare/v0.58.0...v0.59.0
Thanks to @richardguenther for reporting a quadratic case in the HTML table cell renderer. Updating is advised if you deal with user-controlled input.
Thanks to @richardguenther for reporting a quadratic case in the HTML table cell renderer. Updating is advised if you deal with user-controlled input.
Security:
New APIs:
ofm_callouts extension. (by @szdytom in https://github.com/kivikakk/comrak/pull/878)Documentation:
@jeremy-code/comrak-wasm to README.md. (by @jeremy-code in https://github.com/kivikakk/comrak/pull/882)Diff: https://github.com/kivikakk/comrak/compare/v0.57.0...v0.58.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Support wikilink embeds. (by @szdytom in https://github.com/kivikakk/comrak/pull/874)
New APIs:
%% comment syntax, with the ofm_comments extension. (by @szdytom in https://github.com/kivikakk/comrak/pull/876)Dependency updates:
@dependabot[bot] in https://github.com/kivikakk/comrak/pull/871)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/872)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/877)Diff: https://github.com/kivikakk/comrak/compare/v0.56.0...v0.57.0
The headline announcement: Comrak's MSRV has been bumped to 1.89. I really don't like bumping it, but not doing so limits our ongoing access to the de
The headline announcement: Comrak's MSRV has been bumped to 1.89. I really don't like bumping it, but not doing so limits our ongoing access to the developing Rust ecosystem. Thanks for your understanding!
There's also been quite a few pathological edge-cases solved in this release; updating is recommended.
Security:
Parser changes:
Changed APIs:
tagfilter extension has been removed, as I warned in the last release. It's bad. Don't use it. (by @kivikakk in https://github.com/kivikakk/comrak/pull/845)Bug fixes:
Stability:
is_cjk to Unicode 18 & add fast path. (by @tats-u in https://github.com/kivikakk/comrak/pull/838)Performance:
Node::collect_text recursion and some wastefulness. (by @kivikakk in https://github.com/kivikakk/comrak/pull/847)Dependency updates:
@dependabot[bot] in https://github.com/kivikakk/comrak/pull/834)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/841)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/835)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/869)Documentation:
Build changes:
Behind the scenes:
parser::autolink::check_domain make sense. (by @kivikakk in https://github.com/kivikakk/comrak/pull/846)Diff: https://github.com/kivikakk/comrak/compare/v0.55.0...v0.56.0
The tagfilter extension has been marked deprecated, and will be removed in Comrak 0.56.0. (by @kivikakk in https://github.com/kivikakk/comrak/pull/830…
Security:
autolinks extension, which are part of the gfm option set and fairly widely used, and so you almost certainly want to upgrade if you process untrusted content.Stability:
tagfilter extension has been marked deprecated, and will be removed in Comrak 0.56.0. (by @kivikakk in https://github.com/kivikakk/comrak/pull/830)
Dependency updates:
@dependabot[bot] in https://github.com/kivikakk/comrak/pull/825, https://github.com/kivikakk/comrak/pull/827)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/826)Diff: https://github.com/kivikakk/comrak/compare/v0.54.0...v0.55.0
All items marked as deprecated has been removed. You've been warned! (by @kivikakk in https://github.com/kivikakk/comrak/pull/823)
Changed APIs:
aria-hidden, and gets a proper aria-label. It also now appears at the end of the header, not the front.html::collect_text has been moved onto Node (by @kivikakk in https://github.com/kivikakk/comrak/pull/818)New APIs:
Bug fixes:
Dependency updates:
1.1.0+spec-1.1.0 to 1.1.2+spec-1.1.0 (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/819)Diff: https://github.com/kivikakk/comrak/compare/v0.53.0...v0.54.0
--inplace now accepts multiple arguments (by @ilkecan in https://github.com/kivikakk/comrak/pull/792)
Changed APIs:
--inplace now accepts multiple arguments (by @ilkecan in https://github.com/kivikakk/comrak/pull/792)Bug fixes:
~, ~~~ and ::: are escaped in CommonMark output (by @sandmor in https://github.com/kivikakk/comrak/pull/791)Stability:
Dependency updates:
@dependabot[bot] in https://github.com/kivikakk/comrak/pull/793)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/797)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/794, https://github.com/kivikakk/comrak/pull/798, https://github.com/kivikakk/comrak/pull/799)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/810)@dependabot[bot] in https://github.com/kivikakk/comrak/pull/811)Documentation:
Build changes:
--no-default-features. Please read the pull request for more details; suggestions/fixes most appreciated!Diff: https://github.com/kivikakk/comrak/compare/v0.52.0...v0.53.0
Deprecate the option name header_ids in favor of header_id_prefix, to make it clear that the option value actually adds a prefix to the id attribute,…
Happy April!
Reverts:
Changed APIs:
header_ids in favor of header_id_prefix, to make it clear that the option value actually adds a prefix to the id attribute, and add the header_id_prefix_in_href option, which adds the same prefix to generated hrefs. (by @miketheman in https://github.com/kivikakk/comrak/pull/776)> amongst blockquotes won't trigger greentext when enabled.New APIs:
Sourcepos. They report by default in byte columns according to the input UTF-8 source. (by @Martin005 in https://github.com/kivikakk/comrak/pull/779)Dependency updates:
@dependabot[bot] in https://github.com/kivikakk/comrak/pull/778)Documentation:
CONTRIBUTING.md that directs the reader to the README's contributing section. (ddae1558)Build changes:
codegen-units = 1 for release builds. (suggested by @zamazan4ik, added in ea026ef3)Behind the scenes:
Diff: https://github.com/kivikakk/comrak/compare/v0.51.0...v0.52.0
新年快乐! :) What a lovely assortment of improvements, fixes, and new contributors we have in this release. Of particular note, Comrak has gained initial
新年快乐! :) What a lovely assortment of improvements, fixes, and new contributors we have in this release. Of particular note, Comrak has gained initial support for formatting to Typst, thanks to @neilberkman! This is a first cut and there are some known issues — see the PR — but I'm super happy to have folks testing it sooner rather than later!
Changed APIs:
New APIs:
RenderPlugins::codefence_renderers to register language-specific codefence renderers. (by @neilberkman in https://github.com/kivikakk/comrak/pull/751)CodefenceRendererAdapter for language-specific codefence rendering. Its write method receives parsed codefence language and metadata (lang, meta) alongside code and source position. (by @neilberkman in https://github.com/kivikakk/comrak/pull/751)++insert++ extension and guillemet smart punctuation. (by @neilberkman in https://github.com/kivikakk/comrak/pull/754)compact_html render option to suppress newlines in pretty-printing. (by @xvchris in https://github.com/kivikakk/comrak/pull/769)Bug fixes:
sourcepos for inserted table cells. (by @Martin005 in https://github.com/kivikakk/comrak/pull/747)Dependency updates:
unicode_categories with finl_unicode for Unicode character categories. (by @Martin005 in https://github.com/kivikakk/comrak/pull/757)3.8.2 to 3.9.0. (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/759)4.5.54 to 4.5.60. (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/748, https://github.com/kivikakk/comrak/pull/756, https://github.com/kivikakk/comrak/pull/758, https://github.com/kivikakk/comrak/pull/766)0.27.2 to 0.28.0. (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/765)0.3.36 to 0.3.47 in /fuzz. (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/744)0.9.10+spec-1.1.0 to 1.0.3+spec-1.1.0. (by @dependabot[bot] in https://github.com/kivikakk/comrak/pull/742, https://github.com/kivikakk/comrak/pull/760, https://github.com/kivikakk/comrak/pull/767)Documentation:
alerts (admonitions) to README. (by @kritzelkrak in https://github.com/kivikakk/comrak/pull/761)LineColumn, and fix shortcode context link. (by @Martin005 in https://github.com/kivikakk/comrak/pull/764)Diff: https://github.com/kivikakk/comrak/compare/v0.50.0...v0.51.0
The big news is that I've updated Comrak to use Rust 2024, which means our MSRV has been updated to 1.85. I'm sorry if this affects you negatively! Ke
The big news is that I've updated Comrak to use Rust 2024, which means our MSRV has been updated to 1.85. I'm sorry if this affects you negatively! Keeping dependencies up-to-date while respecting our MSRV is basically impossible without the MSRV resolver, and I've spent far too many hours of my short life trying to do without it. Thank you for your understanding 🤍
Bug fixes:
sourcepos for lists before CodeBlocks fixed. (by @Martin005 in https://github.com/kivikakk/comrak/pull/712)sourcepos for HTML and HEEx blocks inside blockquotes fixed. (by @Martin005 in https://github.com/kivikakk/comrak/pull/714)Performance:
Dependency updates:
Documentation:
Build changes:
Behind the scenes:
Diff: https://github.com/kivikakk/comrak/compare/v0.49.0...v0.50.0
Support for Phoenix HEEx has been added! Comrak can now avoid interpreting the contents of HEEx tags, representing them in their own node type in the
New APIs:
x in [x]). (by @kivikakk in https://github.com/kivikakk/comrak/pull/705)Build changes:
Behind the scenes:
find_special_char logic for inlines. (by @liamwhite in https://github.com/kivikakk/comrak/pull/692)byte_matches helper to simplify get/map_or chaining tests in parser. (by @liamwhite in https://github.com/kivikakk/comrak/pull/694)create_formatter macro a bit. (by @nberlette in https://github.com/kivikakk/comrak/pull/704)Diff: https://github.com/kivikakk/comrak/compare/v0.48.0...v0.49.0
The breaking changes are listed right at the top! Please note that AST content now represents NUL bytes (codepoint number zero) as they were in the in…
The breaking changes are listed right at the top! Please note that AST content now represents NUL bytes (codepoint number zero) as they were in the input; these used to be translated to the lovely � character at the very beginning of the input process, presumably so the rest of the reference C parser didn't have to deal with the possibility of strings containing NUL bytes. We can do better, though, so let's! The � character is now emitted by our formatters in place of NUL, but if you use custom or manual formatters and emit any part of the AST content directly (without using comrak::html::escape, context::html::escape_href, or the same-named functions on Context), you may need to do the same translation yourself.
We also no longer append a newline to the end of the file where there wasn't one originally, which meant a lot of places in the parser had to adapt to their strings not necessarily containing a newline before they ended. Careful review and extensive fuzzing should have squeaked out any unexpected overruns, but consider my eyes peeled for reports regarding this. (Ew.) We've cleaned up some sourcepos calculation which depended on this behaviour in odd ways, but there may yet be more to discover which our test suite didn't catch.
Did you know November is Trans Month? I didn't! I'm guessing it's because Trans Awareness Week falls within it, and we've been having a pretty bad time of it rights-wise around the world lately!
Happy Trans Month, and if you happen to typo it as Trans Moth, we can be happy about that too! 🏳️⚧️ ᖭི༏ᖫྀ
Parser changes:
NUL bytes into U+FFFD REPLACEMENT CHARACTER in the parse stage; do it in formatters instead. (by @kivikakk in https://github.com/kivikakk/comrak/pull/681)
NUL bytes where they were present in input, preserving the difference between NUL and literally-entered � characters.Changed APIs:
%25 in hrefs where not part of a percent-encode sequence. (by @kivikakk in https://github.com/kivikakk/comrak/pull/687)
% character alone, such that [link](%%20) would roundtrip without change. It now roundtrips to [link](%25%20).[…], and no longer turns single-byte UTF-8 characters into the Unicode codepoint numbered at the UTF-8 byte (!). (by @kivikakk in https://github.com/kivikakk/comrak/pull/689)New APIs:
highlight extension, ==for highlights==! These render with <mark> in the HTML formatter. (by @pferreir in https://github.com/kivikakk/comrak/pull/672)comrak::Node<'a> as an alias for comrak::nodes::Node<'a>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/673)comrak::Arena<'a> as an alias for typed_arena::Arena<comrak::nodes::AstNode<'a>>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/675)From<(LineColumn, LineColumn)> impl for Sourcepos. (by @kivikakk in https://github.com/kivikakk/comrak/pull/675)comrak::nodes::NodeValue::xml_node_name public, when you want a handy-to-access name for a node type. (by @kivikakk in https://github.com/kivikakk/comrak/pull/673)options.parse.leave_footnote_definitions; this option causes footnote definitions to not be relocated to the bottom of the document, and unused references not to be garbage collected, for use with custom formatters. (by @kivikakk in https://github.com/kivikakk/comrak/pull/673)Bug fixes:
\[x] still being eligible for tasklist inclusion despite the escaped [. (by @kivikakk in https://github.com/kivikakk/comrak/pull/679)Performance:
Build changes:
Behind the scenes:
inlines::Scanner, reducing some needless allocations. (by @kivikakk in https://github.com/kivikakk/comrak/pull/675)all_options fuzzer now fuzzes across all options, and not just with most of them switched on. (by @kivikakk in https://github.com/kivikakk/comrak/pull/678)Diff: https://github.com/kivikakk/comrak/compare/v0.47.0...v0.48.0
Martin Chrástek has fixed _all known sourcepos issues_ in Comrak, while closing a number of other bugs at the same time! I'm so happy.
Martin Chrástek has fixed all known sourcepos issues in Comrak, while closing a number of other bugs at the same time! I'm so happy.
New APIs:
NodeCodeBlock now has a closed property. (by @Martin005 in https://github.com/kivikakk/comrak/pull/661)NodeHeading now has a closed property, for closed ATX-style headings. (by @Martin005 in https://github.com/kivikakk/comrak/pull/665)Bug fixes:
Escaped and EscapedTag no longer fail AST validation when formatting as CommonMark with debug assertions. (by @kivikakk in https://github.com/kivikakk/comrak/pull/662, https://github.com/kivikakk/comrak/pull/664)Build changes:
Diff: https://github.com/kivikakk/comrak/compare/v0.46.0...v0.47.0
Please note the MSRV has been bumped from 1.65 to 1.70; see the pull request for more details. It's a kind of sticky and awkward situation — thanks to
Please note the MSRV has been bumped from 1.65 to 1.70; see the pull request for more details. It's a kind of sticky and awkward situation — thanks to the inevitability of Progress — with no particularly clean solution. (wherein telling GCC 15 users "sorry it just won't build from source for you without messing with dependencies" is not a solution.)
Security:
Parser changes:
New APIs:
subtext extension. (by @Kuuuube in https://github.com/kivikakk/comrak/pull/648, https://github.com/kivikakk/comrak/pull/650)Bug fixes:
escaped_char_span users can now successfully format to CommonMark with debug assertions enabled. These ASTs previously did not validate, which currently is enabled experimentally only in CommonMark output in debug. (by @kivikakk in https://github.com/kivikakk/comrak/pull/659)Build changes:
Diff: https://github.com/kivikakk/comrak/compare/v0.45.0...v0.46.0
…comrak::Render, etc. The old names are marked deprecated. (@kivikakk in https://github.com/kivikakk/comrak/pull/636)
Welcome to v0.45.0! This is a big update, much of them part of from rc.1 from last week. More context on the size of the update in the changelog there.
The biggest library user-facing changes are ergonomic: Node<'a> instead of &'a AstNode<'a>, is nice, and so likewise node.data() instead of node.data.borrow(). They're small, but I appreciate them a lot in my own work.
You'll also notice more bovine creatures in the Comrak pasture: there's a few Cow<str> instead of String, such as in NodeValue::Text. At most an extra .into() will be required; take note if you use any 'static str, as they'll no longer need to be heap-allocated. Some Boxes have been added, too, to reduce the size of every NodeValue. Let the types guide you.
Other than this, the options have been put in their own module (comrak::options), and a lot of things generally cleaned up. Read below for all the deets! Here's the final performance comparison to v0.44.0 on aarch64:
Benchmark 1: ./bench.sh ./comrak-0.44.0
Time (mean ± σ): 88.1 ms ± 1.9 ms [User: 71.2 ms, System: 17.8 ms]
Range (min … max): 86.2 ms … 93.2 ms 31 runs
Benchmark 2: ./bench.sh ./comrak-0.45.0
Time (mean ± σ): 67.0 ms ± 1.2 ms [User: 51.2 ms, System: 17.0 ms]
Range (min … max): 65.2 ms … 70.0 ms 42 runs
Summary
./bench.sh ./comrak-0.45.0 ran
1.32 ± 0.04 times faster than ./bench.sh ./comrak-0.44.0
Be well!
Parser changes:
~ are no longer recognised as valid delimiters, meaning they will not prevent strikethrough recognition when they occur within correct delimiters. See the PR for discussion. (by @miketheman in https://github.com/kivikakk/comrak/pull/635)
cmark-gfm, and follows the intent of the original implementation and implementor (hi!).Changed APIs:
r#unsafe is used instead of unsafe_. (by @kivikakk in https://github.com/kivikakk/comrak/pull/640)--gemojis is renamed to --gemoji. (by @kivikakk in https://github.com/kivikakk/comrak/pull/641)NodeValue::Text now contains a Cow<'static, str> instead of a String. This is a pretty major change, but means we can now create text nodes with static content without duplicating the string on the heap. This particularly benefits smart quotes and HTML entity resolution. (by @kivikakk in https://github.com/kivikakk/comrak/pull/627)
&str without issues); to write in-place, use .to_mut() on the Cow to get a &mut String. To assign, use .into() on a &str or String, like NodeValue::Text("moo".into()).NodeValue::text() now returns a &str. It used to return a &String (!).NodeValue::text_mut() now returns a &mut Cow<'static, str>, instead of a &mut String. This permits writing a borrowed reference.Cow; it'd be amazing to refer continuously to the input where possible.NodeValue's CodeBlock, Table, Link, Image, ShortCode and Alert variants' payloads are now boxed. (by @kivikakk in https://github.com/kivikakk/comrak/pull/632)
Box::new call when constructing these nodes, and on matches, pulling the box out and then just dereferencing it directly (e.g. NodeValue::Table(nt) => &nt.alignments instead of NodeValue::Table(NodeTable { ref alignments }).Ast to 128 bytes, and a full AstNode<'_> to 176 bytes.NodeValue results in worse performance than doing nothing at all. This change appreciably improves matters.Ast.comrak::options. Structs have been renamed to remove Options from their name: comrak::RenderOptions is now comrak::options::Render, etc. The old names are marked deprecated. (@kivikakk in https://github.com/kivikakk/comrak/pull/636)
URLRewriter and BrokenLinkCallback have been moved, without a deprecation period.SyntaxHighlighterAdapter's attributes arguments now take HashMap<&'static str, Cow<'s, str>>; they used to take HashMap<String, String>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/633)html::write_opening_tag can now take different AsRef<str> types for the attribute key and value.parse_document_with_broken_link_callback has been removed! This entrypoint has been deprecated since 0.25.0. (by @kivikakk in https://github.com/kivikakk/comrak/pull/623)options.render.ignore_setext was moved to options.parse.ignore_setext, as its effect takes place only in the parse stage. (by @kivikakk in https://github.com/kivikakk/comrak/pull/623)nodes::can_contain_type is now Node::can_contain_type. (by @kivikakk in https://github.com/kivikakk/comrak/pull/625)New APIs:
node.data() and node.data_mut() are added as short-hand for node.data.borrow() and node.data.borrow_mut() respectively. (by @kivikakk in https://github.com/kivikakk/comrak/pull/643)comrak::nodes::Node<'a> is introduced as an alias for &'a comrak::nodes::AstNode<'a>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/627)options.parse.tasklist_in_table added: parse a tasklist item if it's the only content of a table cell. (by @kivikakk in https://github.com/kivikakk/comrak/pull/622)Performance:
str internally in block and inline processing, eliminating many UTF-8 rechecks. The strings module actually operates on strings now. (by @kivikakk in https://github.com/kivikakk/comrak/pull/626)Dependency updates:
memchr removed from Cargo.toml; it wasn't used directly, though it still is included unconditionally due to caseless. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)slug is moved to a development-only dependency; it's only used in an example. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)jetscii is added for faster string searching, including SIMD on x86_64. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)
Documentation:
README example code is updated to build with recent API changes. (by @kivikakk in https://github.com/kivikakk/comrak/pull/621)Build changes:
shortcodes is enabled by default (but still optional) for CLI builds. (by @kivikakk in https://github.com/kivikakk/comrak/pull/641)syntect is now optional (but still default) in CLI builds. (by @kivikakk in https://github.com/kivikakk/comrak/pull/624)Behind the scenes:
unsafe blocks now have a SAFETY comment describing why their actions are safe.Diff: https://github.com/kivikakk/comrak/compare/v0.44.0...v0.45.0
…comrak::Render, etc. The old names are marked deprecated. (@kivikakk in https://github.com/kivikakk/comrak/pull/636)
This is a release candidate for v0.45.0. I've never made a release candidate for Comrak before, but then I've probably never made a release of this size before either.
Why the big changes? Quite simply, for the first time in over five years I'm once again working on CommonMark in my day job, and for the first time ever using Comrak in it too, and so I find myself thinking about it more, cutting myself on the sharp edges, wishing it were easier to maintain, and wishing it were more efficient. For a little while now, too, I've been speculating about calling version 1.0.
So let's get there. This weekend I found myself profiling and reworking Obviously 2018 Code, and low-hanging fruit, oh my, they are aplenty.
It's awkward to do an apples-to-apples comparison of speed between 0.44.0 and 0.45.0-rc.1, because 0.44.0's Comrak benchmark neglected to turn off syntax highlighting, while the benchmark input has something like 14,000 code blocks in it. We were kiiiinda benchmarking syntect. The benchmark also started the target process 33 times per run, which adds a lot of undesireable pair.
Anyway, I compared the pair using the new benchmark strategy of running the process just once per run, syntax highlighting disabled. Here's what we get on aarch64; on x86_64 the improvement is slightly greater thanks to SIMD:
Benchmark 1: ./bench.sh ./comrak-0.44.0
Time (mean ± σ): 90.0 ms ± 1.0 ms [User: 71.9 ms, System: 18.9 ms]
Range (min … max): 88.3 ms … 92.9 ms 31 runs
Benchmark 2: ./bench.sh ./comrak-0.45.0-rc.1
Time (mean ± σ): 70.4 ms ± 0.9 ms [User: 53.5 ms, System: 17.9 ms]
Range (min … max): 69.1 ms … 73.7 ms 40 runs
Summary
./bench.sh ./comrak-0.45.0-rc.1 ran
1.28 ± 0.02 times faster than ./bench.sh ./comrak-0.44.0
LGTM!
Changed APIs:
NodeValue::Text now contains a Cow<'static, str> instead of a String. This is a pretty major change, but means we can now create text nodes with static content without duplicating the string on the heap. This particularly benefits smart quotes and HTML entity resolution. (by @kivikakk in https://github.com/kivikakk/comrak/pull/627)
&str without issues); to write in-place, use .to_mut() on the Cow to get a &mut String. To assign, use .into() on a &str or String, like NodeValue::Text("moo".into()).NodeValue::text() now returns a &str. It used to return a &String (!).NodeValue::text_mut() now returns a &mut Cow<'static, str>, instead of a &mut String. This permits writing a borrowed reference.Cow; it'd be amazing to refer continuously to the input where possible.NodeValue's CodeBlock, Table, Link, Image, ShortCode and Alert variants' payloads are now boxed. (by @kivikakk in https://github.com/kivikakk/comrak/pull/632)
Box::new call when constructing these nodes, and on matches, pulling the box out and then just dereferencing it directly (e.g. NodeValue::Table(nt) => &nt.alignments instead of NodeValue::Table(NodeTable { ref alignments }).Ast to 128 bytes, and a full AstNode<'_> to 176 bytes.NodeValue results in worse performance than doing nothing at all. This change appreciably improves matters.Ast.comrak::options. Structs have been renamed to remove Options from their name: comrak::RenderOptions is now comrak::options::Render, etc. The old names are marked deprecated. (@kivikakk in https://github.com/kivikakk/comrak/pull/636)
URLRewriter and BrokenLinkCallback have been moved, without a deprecation period.SyntaxHighlighterAdapter's attributes arguments now take HashMap<&'static str, Cow<'s, str>>; they used to take HashMap<String, String>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/633)html::write_opening_tag can now take different AsRef<str> types for the attribute key and value.parse_document_with_broken_link_callback has been removed! This entrypoint has been deprecated since 0.25.0. (by @kivikakk in https://github.com/kivikakk/comrak/pull/623)options.render.ignore_setext was moved to options.parse.ignore_setext, as its effect takes place only in the parse stage. (by @kivikakk in https://github.com/kivikakk/comrak/pull/623)nodes::can_contain_type is now Node::can_contain_type. (by @kivikakk in https://github.com/kivikakk/comrak/pull/625)New APIs:
comrak::nodes::Node<'a> is introduced as an alias for &'a comrak::nodes::AstNode<'a>. (by @kivikakk in https://github.com/kivikakk/comrak/pull/627)options.parse.tasklist_in_table added: parse a tasklist item if it's the only content of a table cell. (by @kivikakk in https://github.com/kivikakk/comrak/pull/622)Performance:
str internally in block and inline processing, eliminating many UTF-8 rechecks. The strings module actually operates on strings now. (by @kivikakk in https://github.com/kivikakk/comrak/pull/626)Dependency updates:
memchr removed from Cargo.toml; it wasn't used directly, though it still is included unconditionally due to caseless. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)slug is moved to a development-only dependency; it's only used in an example. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)jetscii is added for faster string searching, including SIMD on x86_64. (by @kivikakk in https://github.com/kivikakk/comrak/pull/630)
Documentation:
README example code is updated to build with recent API changes. (by @kivikakk in https://github.com/kivikakk/comrak/pull/621)Build changes:
syntect is now optional (but still default) in CLI builds. (by @kivikakk in https://github.com/kivikakk/comrak/pull/624)Behind the scenes:
unsafe blocks now have a SAFETY comment describing why their actions are safe.Diff: https://github.com/kivikakk/comrak/compare/v0.44.0...v0.45.0-rc.1
Autolink validation is now stricter in the default mode, to maintain conformance with the GitHub Flavored Markdown autolinks extension spec. Those par
Parser changes:
http://localhost (!), www.com (!?), or https:// (!?!) --- are now part of the relaxed_autolinks option. See more discussion in the PR. (by @chamlis in https://github.com/kivikakk/comrak/pull/618)New APIs:
inline_footnotes extension and using the syntax ^[footnote content] (by @sheremetyev in https://github.com/kivikakk/comrak/pull/619)Diff: https://github.com/kivikakk/comrak/compare/v0.43.0...v0.44.0
superscript or subscript extensions only: punctuation following a superscript or subscript delimiter no longer disqualifies the delimiter from being c
Parser changes:
superscript or subscript extensions only: punctuation following a superscript or subscript delimiter no longer disqualifies the delimiter from being considered left-flanking, such that e^-i^ and n~-i~ now parse as superscript or subscript respectively (by @kivikakk in https://github.com/kivikakk/comrak/pull/593)Changed APIs:
html::format_document, xml::format_document, cm::format_document and friends now take an std::fmt::Write as their output argument, instead of an std::io::Write, to avoid revalidating UTF-8 (by @kivikakk in https://github.com/kivikakk/comrak/pull/601)--header-ids '' for prefix-less headers (by @kivikakk in https://github.com/kivikakk/comrak/pull/610)New APIs:
Documentation updates:
cargo binstall by (@tats-u in https://github.com/kivikakk/comrak/pull/608)Diff: https://github.com/kivikakk/comrak/compare/v0.42.0...v0.43.0
cm::escape_inline (aliased at crate level as escape_commonmark_inline) is added; escapes input text suitable for inclusion in a CommonMark document wh
New APIs:
cm::escape_inline (aliased at crate level as escape_commonmark_inline) is added; escapes input text suitable for inclusion in a CommonMark document where regular inline processing takes place. (by @kivikakk in https://github.com/kivikakk/comrak/pull/602)cm::escape_link_destination (aliased at crate level as escape_commonmark_link_destination) is added; escapes input URL suitable for use as a link destination in a CommonMark document. (by @kivikakk in https://github.com/kivikakk/comrak/pull/605)Changed APIs:
html::collect_text now returns a String. html::collect_text_append is added if you still want to start with your own (String) buffer. (by @kivikakk in https://github.com/kivikakk/comrak/pull/600)
Vec<u8> instead of a String; it was just old.Anchorizer::anchorizer now takes &str instead of a String. (by @kivikakk in https://github.com/kivikakk/comrak/pull/603)
Updates:
is_cjk in CJK Friendly Emphasis to Unicode 17. (by @tats-u in https://github.com/kivikakk/comrak/pull/598)Behind the scenes:
Diff: https://github.com/kivikakk/comrak/compare/v0.41.1...v0.42.0
Fix the range of non-emoji general purpose variation selector by @tats-u in https://github.com/kivikakk/comrak/pull/596
Bug fixes:
Stability:
Behind the scenes:
relaxed_autolink_email_in_footnote test by @Mrmaxmeier in https://github.com/kivikakk/comrak/pull/594Diff: https://github.com/kivikakk/comrak/compare/v0.41.0...v0.41.1
Add CJK friendly emphasis extension by @tats-u in https://github.com/kivikakk/comrak/pull/582
New features:
Build changes:
Diff: https://github.com/kivikakk/comrak/compare/v0.40.0...v0.41.0
"Fix header-ids accessibility" was reverted in https://github.com/kivikakk/comrak/commit/2cb6188bfb4c5d69bf55c73c19b2049e9dfe5dba
Reverts:
Bug fixes:
New APIs:
Diff: https://github.com/kivikakk/comrak/compare/v0.39.1...v0.40.0
Fix header-ids accessibility by @davemackintosh in https://github.com/kivikakk/comrak/pull/574
Bug fixes:
Diff: https://github.com/kivikakk/comrak/compare/v0.39.0...v0.39.1
Make dangerous_url public by @digitalmoksha in https://github.com/kivikakk/comrak/pull/564
New APIs:
Diff: https://github.com/kivikakk/comrak/compare/v0.38.0...v0.39.0
Only delete parent if the node has no siblings by @digitalmoksha in https://github.com/kivikakk/comrak/pull/559
Bug fixes:
New features/APIs:
Coming of age???:
Diff: https://github.com/kivikakk/comrak/compare/v0.37.0...v0.38.0
add --all-features to CI matrix, add missing shortcode case. by @charlottia in https://github.com/kivikakk/comrak/pull/546
Bug fixes:
Documentation:
Diff: https://github.com/kivikakk/comrak/compare/v0.36.0...v0.37.0
Stop at first suitable $ at inline math by @Bubbis in https://github.com/kivikakk/comrak/pull/533
Bug fixes:
New features/APIs:
AlertType methods public by @fiji-flo in https://github.com/kivikakk/comrak/pull/532Behind the scenes:
NodeValue variant by @SamWilsn in https://github.com/kivikakk/comrak/pull/498Documentation:
Diff: https://github.com/kivikakk/comrak/compare/v0.35.0...v0.36.0
Use CSS class markdown-alert instead of alert by @digitalmoksha in https://github.com/kivikakk/comrak/pull/524
markdown-alert instead of alert by @digitalmoksha in https://github.com/kivikakk/comrak/pull/524Diff: https://github.com/kivikakk/comrak/compare/v0.34.0...v0.35.0
Add GitHub style alerts / admonitions by @digitalmoksha in https://github.com/kivikakk/comrak/pull/519
Admonition special!
Diff: https://github.com/kivikakk/comrak/compare/v0.33.0...v0.34.0
Happy new year! Thanks to @nicoburns for these changes, enabling much faster compiles if you don't need the builders!
Happy new year! Thanks to @nicoburns for these changes, enabling much faster compiles if you don't need the builders!
regex and once_cell dependencies. by @nicoburns in https://github.com/kivikakk/comrak/pull/514Diff: https://github.com/kivikakk/comrak/compare/v0.32.0...v0.33.0
rust-toolchain: remove by @charlottia in https://github.com/kivikakk/comrak/pull/493
sourcepos by @SamWilsn in https://github.com/kivikakk/comrak/pull/494wikilinks_title_after_pipe override wikilinks_title_before_pipe by @SamWilsn in https://github.com/kivikakk/comrak/pull/500Diff: https://github.com/kivikakk/comrak/compare/v0.31.0...v0.32.0
Enhance description lists by @digitalmoksha in https://github.com/kivikakk/comrak/pull/462
Diff: https://github.com/kivikakk/comrak/compare/v0.30.0...v0.31.0
Add task-list-item class to task list items by @nicoburns in https://github.com/kivikakk/comrak/pull/468
task-list-item class to task list items by @nicoburns in https://github.com/kivikakk/comrak/pull/468bon for an infallible and compile-time-checked builder by @Veetaha in https://github.com/kivikakk/comrak/pull/466bon version to 3.0 by @Veetaha in https://github.com/kivikakk/comrak/pull/487Diff: https://github.com/kivikakk/comrak/compare/v0.29.0...v0.30.0
Add support for backslash escape in wikilinks by @digitalmoksha in https://github.com/kivikakk/comrak/pull/471
Diff: https://github.com/kivikakk/comrak/compare/v0.28.0...v0.29.0
Add a render option to render the image as by @JmPotato in https://github.com/kivikakk/comrak/pull/458
<figure> by @JmPotato in https://github.com/kivikakk/comrak/pull/458Diff: https://github.com/kivikakk/comrak/compare/v0.27.0...v0.28.0
Track line offsets for better accuracy of inline sourcepos by @digitalmoksha in https://github.com/kivikakk/comrak/pull/453
Diff: https://github.com/kivikakk/comrak/compare/v0.26.0...v0.27.0
Restore inline sourcepos as experimental. by @kivikakk in https://github.com/kivikakk/comrak/pull/444
Diff: https://github.com/kivikakk/comrak/compare/v0.25.0...v0.26.0
parse_document_with_broken_link_callback has been marked deprecated.
extension.underline adds support for __underlined__ text.extension.spoiler adds support for ||spoiler|| text.extension.greentext adds support for image board-style >greentext, which isn't transformed into a blockquote.render.ignore_setext disables parsing setext-style headings.render.ignore_empty_links causes links with no text (like [](xyz)) to remain in the text as-is.AstNode::from(NodeValue).AstNode::from(Ast), if you have sourcepos.cmark-gfm. These have been fixed by following upstream's parser design closely.+. We do now.arena_tree would silently stop iteration when trying to proceed from a child that had lost its parent. It now panics instead, as the old behaviour is incorrect and impossible to notice.ParseOptions (which now takes a lifetime, meaning Options does too).parse_document_with_broken_link_callback has been marked deprecated.Diff: https://github.com/kivikakk/comrak/compare/v0.24.1...v0.25.0
Miscellany. by @kivikakk in https://github.com/kivikakk/comrak/pull/387
Full Changelog: https://github.com/kivikakk/comrak/compare/0.23.0...v0.24.1
Diff: https://github.com/kivikakk/comrak/compare/v0.24.0...v0.24.1
Full Changelog: https://github.com/kivikakk/comrak/compare/v0.23.1-pre.2...v0.23.1-pre.3
Full Changelog: https://github.com/kivikakk/comrak/compare/v0.23.1-pre.2...v0.23.1-pre.3
Miscellany. by @kivikakk in https://github.com/kivikakk/comrak/pull/387
Full Changelog: https://github.com/kivikakk/comrak/compare/0.23.0...v0.23.1-pre.2
add traverse() demo example by @kaesluder in https://github.com/kivikakk/comrak/pull/370
--inplace (-i) for in-place formatting by @bioinformatist in https://github.com/kivikakk/comrak/pull/377relaxed-autolinks to allow any url scheme by @digitalmoksha in https://github.com/kivikakk/comrak/pull/380Full Changelog: https://github.com/kivikakk/comrak/compare/0.22.0...0.23.0
Fix broken docs link in README by @ohakutsu in https://github.com/kivikakk/comrak/pull/364
Full Changelog: https://github.com/kivikakk/comrak/compare/0.21.0...0.22.0
Add a multiline blockquote extension by @digitalmoksha in https://github.com/kivikakk/comrak/pull/359
Full Changelog: https://github.com/kivikakk/comrak/compare/0.20.0...0.21.0
build(deps): bump rustix from 0.36.11 to 0.36.16 in /fuzz by @dependabot in https://github.com/kivikakk/comrak/pull/346
Full Changelog: https://github.com/kivikakk/comrak/compare/0.19.0...0.20.0
Simplify anchorize() by @kornelski in https://github.com/kivikakk/comrak/pull/297
ComrakFoo types to just Foo for easier usage by @tgross35 in https://github.com/kivikakk/comrak/pull/320ComrakExtensionOptions non-exhaustive by @CosmicHorrorDev in https://github.com/kivikakk/comrak/pull/305Full Changelog: https://github.com/kivikakk/comrak/compare/0.18.0...0.19.0
Improve performance of bundled plugins, and streaming I/O by @kivikakk in https://github.com/kivikakk/comrak/pull/288
Full Changelog: https://github.com/kivikakk/comrak/compare/0.17.1...0.18.0
Fix some panics found by trivial fuzzing.
Full Changelog: https://github.com/kivikakk/comrak/compare/0.17.0...0.17.1
Missed from the 0.17.0 changelog:
This contains some breaking changes from an API point of view, but output is largely unchanged. Spec compliance is improved, and benchmark runtime is…
This contains some breaking changes from an API point of view, but output is largely unchanged. Spec compliance is improved, and benchmark runtime is over 20% faster.
Vec<u8>s, and instead store Strings.Many thanks to @philipturnbull and @darakian of the GitHub Security Lab for bringing these issues to my attention and detailing the reproduction steps for each case.
Full Changelog: https://github.com/kivikakk/comrak/compare/0.16.0...0.17.0
Track which symbol was used to mark task item as checked by @felipesere in https://github.com/kivikakk/comrak/pull/252
shortcodes to the README by @gjtorikian in https://github.com/kivikakk/comrak/pull/263Full Changelog: https://github.com/kivikakk/comrak/compare/0.15.0...0.16.0
table: fix start_line of Table itself by @kivikakk in https://github.com/kivikakk/comrak/pull/231
comrak_set_parse_option_smart by @gjtorikian in https://github.com/kivikakk/comrak/pull/235c_char options to be NULL by @gjtorikian in https://github.com/kivikakk/comrak/pull/237lazy_static dependency with once_cell by @Turbo87 in https://github.com/kivikakk/comrak/pull/238comrak --help readable on my terminal by @mgeisler in https://github.com/kivikakk/comrak/pull/242Full Changelog: https://github.com/kivikakk/comrak/compare/0.14.0...0.15.0
crates.io: https://crates.io/crates/comrak/0.15.0
Allow for C-style dynamic libraries to be produced by @gjtorikian in https://github.com/kivikakk/comrak/pull/171
Full Changelog: https://github.com/kivikakk/comrak/compare/0.13.2...0.14.0
crates.io: https://crates.io/crates/comrak/0.14.0
On crates.io: https://crates.io/crates/comrak/0.13.2
Changes since last release (https://github.com/kivikakk/comrak/compare/0.13.1...0.13.2)
On crates.io: https://crates.io/crates/comrak/0.13.2
Replace deprecated twoway dependency.
Changes since last release (https://github.com/kivikakk/comrak/compare/0.13.0...0.13.1)
On crates.io: https://crates.io/crates/comrak/0.13.1
Windows build includes c465cb5.
SECURITY: Bump regex to 1.5.5. (#221, Dependabot)
Changes since last release (https://github.com/kivikakk/comrak/compare/0.12.1...0.13.0)
On crates.io: https://crates.io/crates/comrak/0.13.0
Only load syntax and theme sets once, on Syntect plugin instantiation.
Changes since last release (https://github.com/kivikakk/comrak/compare/0.12.0...0.12.1)
On crates.io: https://crates.io/crates/comrak/0.12.1
Add pluggable syntax highlighting, and default implementation with syntect. (Daniel Simon, #194)
Changes since last release (https://github.com/kivikakk/comrak/compare/0.11.0...0.12.0)
On crates.io: https://crates.io/crates/comrak/0.12.0
Allow short URLs even with non-empty path. (#191, Bernard Teo)
Changes since last release (https://github.com/kivikakk/comrak/compare/0.10.1...0.11.0)
On crates.io: https://crates.io/crates/comrak/0.11.0
SECURITY: it was possible to smuggle unsafe URLs --- like javascript: ones --- even without using the "unsafe" mode of operation. Thanks to Sam Sanoop
Changes since last release (https://github.com/kivikakk/comrak/compare/0.10.0...0.10.1)
javascript: ones --- even without using the "unsafe" mode of operation. Thanks to Sam Sanoop (snoopysecurity) for reporting.On crates.io: https://crates.io/crates/comrak/0.10.1
Interim crate release for https://github.com/rust-lang/crates.io/issues/3501. See #182, #183.
Interim crate release for https://github.com/rust-lang/crates.io/issues/3501. See #182, #183.
One column per quarter.