markdown-it-autolink

A markdown-it plugin for parsing GFM autolinks

2 unstable releases

0.2.0 Aug 3, 2023
0.1.0 Jun 26, 2023

#1132 in Text processing

Download history 16/week @ 2024-07-15 13/week @ 2024-07-22 37/week @ 2024-07-29 16/week @ 2024-08-05 19/week @ 2024-08-12 13/week @ 2024-08-19 21/week @ 2024-08-26 8/week @ 2024-09-02 24/week @ 2024-09-09 16/week @ 2024-09-16 38/week @ 2024-09-23 21/week @ 2024-09-30 20/week @ 2024-10-07 8/week @ 2024-10-14 160/week @ 2024-10-21 90/week @ 2024-10-28

279 downloads per month
Used in markdown-it-gfm

Apache-2.0

30KB
575 lines

markdown-it-autolink.rs

crates.io

A markdown-it.rs plugin that implements the Github Flavoured Markdown autolink extension.

Usage

let md = &mut markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(md);
markdown_it_autolink::add(md);
md.parse("www.example.com").render();
// <p><a href="http://www.example.com">www.example.com</a></p>

lib.rs:

Implement the Github Flavoured Markdown autolink extension.

let md = &mut markdown_it::MarkdownIt::new();
markdown_it::plugins::cmark::add(md);
markdown_it_autolink::add(md);

assert_eq!(
    md.parse("www.example.com").render(),
    "<p><a href=\"http://www.example.com\">www.example.com</a></p>\n",
);

Dependencies

~6–14MB
~199K SLoC