From ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 10:40:01 +0200 Subject: Rename crate to `markdown` --- .github/contribute.md | 4 +- .github/support.md | 2 +- .github/workflows/main.yml | 2 +- Cargo.toml | 6 +- benches/bench.rs | 5 +- build.rs | 6 +- examples/lib.rs | 26 +- fuzz/Cargo.toml | 8 +- fuzz/fuzz_targets/micromark.rs | 12 +- readme.md | 73 +- src/lib.rs | 168 +-- src/subtokenize.rs | 2 +- src/to_html.rs | 2 +- src/util/character_reference.rs | 6 +- src/util/encode.rs | 2 +- src/util/gfm_tagfilter.rs | 2 +- src/util/normalize_identifier.rs | 2 +- src/util/sanitize_uri.rs | 6 +- src/util/slice.rs | 2 +- tests/attention.rs | 272 ++--- tests/autolink.rs | 88 +- tests/block_quote.rs | 74 +- tests/character_escape.rs | 32 +- tests/character_reference.rs | 68 +- tests/code_fenced.rs | 96 +- tests/code_indented.rs | 64 +- tests/code_text.rs | 58 +- tests/commonmark.rs | 1308 +++++++++++----------- tests/definition.rs | 164 +-- tests/frontmatter.rs | 28 +- tests/fuzz.rs | 14 +- tests/gfm_autolink_literal.rs | 132 +-- tests/gfm_footnote.rs | 110 +- tests/gfm_strikethrough.rs | 36 +- tests/gfm_table.rs | 134 +-- tests/gfm_tagfilter.rs | 12 +- tests/gfm_task_list_item.rs | 20 +- tests/hard_break_escape.rs | 22 +- tests/hard_break_trailing.rs | 44 +- tests/heading_atx.rs | 76 +- tests/heading_setext.rs | 98 +- tests/html_flow.rs | 306 ++--- tests/html_text.rs | 144 +-- tests/image.rs | 78 +- tests/link_reference.rs | 128 ++- tests/link_resource.rs | 156 +-- tests/list.rs | 196 ++-- tests/math_flow.rs | 86 +- tests/math_text.rs | 60 +- tests/mdx_esm.rs | 66 +- tests/mdx_expression_flow.rs | 68 +- tests/mdx_expression_text.rs | 84 +- tests/mdx_jsx_flow.rs | 44 +- tests/mdx_jsx_text.rs | 280 +++-- tests/mdx_swc.rs | 14 +- tests/misc_bom.rs | 8 +- tests/misc_dangerous_html.rs | 10 +- tests/misc_dangerous_protocol.rs | 66 +- tests/misc_default_line_ending.rs | 18 +- tests/misc_line_ending.rs | 66 +- tests/misc_soft_break.rs | 8 +- tests/misc_tabs.rs | 92 +- tests/misc_url.rs | 40 +- tests/misc_zero.rs | 12 +- tests/test_utils/hast.rs | 6 +- tests/test_utils/hast_util_to_swc.rs | 2 +- tests/test_utils/mdast_util_to_hast.rs | 2 +- tests/test_utils/mdx.rs | 4 +- tests/test_utils/mdx_plugin_recma_document.rs | 2 +- tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs | 2 +- tests/test_utils/swc.rs | 6 +- tests/test_utils/swc_utils.rs | 2 +- tests/text.rs | 10 +- tests/thematic_break.rs | 64 +- tests/xxx_hast_util_to_swc.rs | 2 +- tests/xxx_mdast_util_to_hast.rs | 4 +- tests/xxx_mdx.rs | 2 +- tests/xxx_mdx_plugin_recma_document.rs | 6 +- tests/xxx_mdx_plugin_recma_jsx_rewrite.rs | 6 +- 79 files changed, 2711 insertions(+), 2725 deletions(-) diff --git a/.github/contribute.md b/.github/contribute.md index a59fe01..3a59ba4 100644 --- a/.github/contribute.md +++ b/.github/contribute.md @@ -82,6 +82,6 @@ See [Project][] for more info. [coc]: code-of-conduct.md -[sponsor]: https://github.com/wooorm/micromark-rs/#sponsor +[sponsor]: https://github.com/wooorm/markdown-rs/#sponsor -[project]: https://github.com/wooorm/micromark-rs/#project +[project]: https://github.com/wooorm/markdown-rs/#project diff --git a/.github/support.md b/.github/support.md index afc8aaf..7a8c644 100644 --- a/.github/support.md +++ b/.github/support.md @@ -49,7 +49,7 @@ See [`contribute.md`][contribute] on how to contribute. [xy]: https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378 -[chat]: https://github.com/wooorm/micromark-rs/discussions +[chat]: https://github.com/wooorm/markdown-rs/discussions [contribute]: contribute.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9bc7e3..600b4d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: # - run: cargo install cargo-tarpaulin && cargo tarpaulin --out Xml # - uses: codecov/codecov-action@v1 - run: cargo doc --no-deps --release - - run: echo 'Redirecting…

Redirecting…

Click here if you are not redirected.' > target/doc/index.html + - run: echo 'Redirecting…

Redirecting…

Click here if you are not redirected.' > target/doc/index.html - name: Deploy uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/Cargo.toml b/Cargo.toml index ef0d46e..b794a87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "micromark" +name = "markdown" version = "0.0.0" authors = ["Titus Wormer "] edition = "2018" rust-version = "1.56" description = "small commonmark compliant markdown parser with positional info and concrete tokens" -homepage = "https://github.com/micromark/micromark-rs" -repository = "https://github.com/micromark/micromark-rs" +homepage = "https://github.com/wooorm/markdown-rs" +repository = "https://github.com/wooorm/markdown-rs" license = "MIT" keywords = ["commonmark", "markdown", "parse", "render", "tokenize"] categories = ["compilers", "encoding", "parser-implementations", "parsing", "text-processing"] diff --git a/benches/bench.rs b/benches/bench.rs index d72e7c3..5ba0e16 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -1,14 +1,13 @@ #[macro_use] extern crate criterion; use criterion::{BenchmarkId, Criterion}; -use micromark::micromark; use std::fs; fn readme(c: &mut Criterion) { let doc = fs::read_to_string("readme.md").unwrap(); c.bench_with_input(BenchmarkId::new("readme", "readme"), &doc, |b, s| { - b.iter(|| micromark(s)); + b.iter(|| markdown::to_html(s)); }); } @@ -17,7 +16,7 @@ fn readme(c: &mut Criterion) { // let mut group = c.benchmark_group("giant"); // group.sample_size(10); // group.bench_with_input(BenchmarkId::new("giant", "1.5 mb"), &doc, |b, s| { -// b.iter(|| micromark(s)); +// b.iter(|| markdown::to_html(s)); // }); // group.finish(); // } diff --git a/build.rs b/build.rs index e9d8bda..3ed1e8d 100644 --- a/build.rs +++ b/build.rs @@ -53,7 +53,7 @@ async fn commonmark() { format!("{}\n", parts[1]) }; - let test = format!(" assert_eq!(\n micromark_with_options(\n r###\"{}\"###,\n &danger\n )?,\n r###\"{}\"###,\n r###\"{} ({})\"###\n);", input, output, section, number); + let test = format!(" assert_eq!(\n to_html_with_options(\n r###\"{}\"###,\n &danger\n )?,\n r###\"{}\"###,\n r###\"{} ({})\"###\n);", input, output, section, number); cases.push(test); @@ -67,8 +67,8 @@ async fn commonmark() { // > 👉 **Important**: this module is generated by `build.rs`. // > It is generate from the latest CommonMark website. -extern crate micromark; -use micromark::{{micromark_with_options, CompileOptions, Options}}; +extern crate markdown; +use markdown::{{to_html_with_options, CompileOptions, Options}}; use pretty_assertions::assert_eq; #[rustfmt::skip] diff --git a/examples/lib.rs b/examples/lib.rs index d14f399..6d156df 100644 --- a/examples/lib.rs +++ b/examples/lib.rs @@ -1,7 +1,4 @@ -extern crate micromark; -use micromark::{ - micromark, micromark_to_mdast, micromark_with_options, CompileOptions, Options, ParseOptions, -}; +extern crate markdown; fn main() -> Result<(), String> { // Turn on debugging. @@ -9,20 +6,20 @@ fn main() -> Result<(), String> { env_logger::init(); // Safely turn (untrusted?) markdown into HTML. - println!("{:?}", micromark("## Hello, *world*!")); + println!("{:?}", markdown::to_html("## Hello, *world*!")); // Turn trusted markdown into HTML. println!( "{:?}", - micromark_with_options( + markdown::to_html_with_options( "

\n\n# Hello, tomato!\n\n
", - &Options { - compile: CompileOptions { + &markdown::Options { + compile: markdown::CompileOptions { allow_dangerous_html: true, allow_dangerous_protocol: true, - ..CompileOptions::default() + ..markdown::CompileOptions::default() }, - ..Options::default() + ..markdown::Options::default() } ) ); @@ -30,16 +27,19 @@ fn main() -> Result<(), String> { // Support GFM extensions. println!( "{}", - micromark_with_options( + markdown::to_html_with_options( "* [x] contact@example.com ~~strikethrough~~", - &Options::gfm() + &markdown::Options::gfm() )? ); // Access syntax tree and support MDX extensions: println!( "{:?}", - micromark_to_mdast("# , {username}!", &ParseOptions::mdx())? + markdown::to_mdast( + "# , {username}!", + &markdown::ParseOptions::mdx() + )? ); Ok(()) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 3c19003..c8f9850 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "micromark-fuzz" +name = "markdown-fuzz" version = "0.0.0" authors = ["Automatically generated"] publish = false @@ -11,7 +11,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -[dependencies.micromark] +[dependencies.markdown] path = ".." # Prevent this from interfering with workspaces @@ -19,7 +19,7 @@ path = ".." members = ["."] [[bin]] -name = "micromark" -path = "fuzz_targets/micromark.rs" +name = "markdown" +path = "fuzz_targets/markdown.rs" test = false doc = false diff --git a/fuzz/fuzz_targets/micromark.rs b/fuzz/fuzz_targets/micromark.rs index 2137e0e..c058637 100644 --- a/fuzz/fuzz_targets/micromark.rs +++ b/fuzz/fuzz_targets/micromark.rs @@ -1,15 +1,15 @@ #![no_main] use libfuzzer_sys::fuzz_target; -extern crate micromark; +extern crate markdown; fuzz_target!(|data: &[u8]| { if let Ok(s) = std::str::from_utf8(data) { - let _ = micromark::micromark(s); - let _ = micromark::micromark_with_options( + let _ = markdown::to_html(s); + let _ = markdown::to_html_with_options( s, - µmark::Options::gfm() + &markdown::Options::gfm() ); - let _ = micromark::micromark_to_mdast(s, µmark::ParseOptions::default()); - let _ = micromark::micromark_to_mdast(s, µmark::ParseOptions::gfm()); + let _ = markdown::to_mdast(s, &markdown::ParseOptions::default()); + let _ = markdown::to_mdast(s, &markdown::ParseOptions::gfm()); } }); diff --git a/readme.md b/readme.md index e13c30c..b9da918 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ -# micromark-rs +# markdown-rs - + @@ -33,7 +33,7 @@ CommonMark compliant markdown parser in Rust with ASTs and extensions. ## What is this? -micromark is an open source markdown parser written in Rust. +`markdown-rs` is an open source markdown parser written in Rust. It’s implemented as a state machine (`#![no_std]` + `alloc`) that emits concrete tokens, so that every byte is accounted for, with positional info. The API then exposes this information as an AST, which is easier to work with, @@ -75,17 +75,16 @@ to markdown such as MDX, math, and frontmatter. With [Rust][] (rust edition 2018+, ±version 1.56+), install with `cargo`: ```sh -cargo install micromark +cargo install markdown ``` ## Use ```rs -extern crate micromark; -use micromark::micromark; +extern crate markdown; fn main() { - println!("{}", micromark("## Hello, *world*!")); + println!("{}", markdown::to_html("## Hello, *world*!")); } ``` @@ -98,15 +97,14 @@ Yields: Extensions (in this case GFM): ```rs -extern crate micromark; -use micromark::{micromark_with_options, Options}; +extern crate markdown; fn main() -> Result<(), String> { println!( "{}", - micromark_with_options( + markdown::to_html_with_options( "* [x] contact@example.com ~~strikethrough~~", - &Options::gfm() + &markdown::Options::gfm() )? ); @@ -129,13 +127,12 @@ Yields: Syntax tree ([mdast][]): ```rs -extern crate micromark; -use micromark::{micromark_to_mdast, ParseOptions}; +extern crate markdown; fn main() -> Result<(), String> { println!( "{:?}", - micromark_to_mdast("# Hey, *you*!", &ParseOptions::default())? + markdown::to_mdast("# Hey, *you*!", &markdown::ParseOptions::default())? ); Ok(()) @@ -150,18 +147,18 @@ Root { children: [Heading { children: [Text { value: "Hey, ", position: Some(1:3 ## API -`micromark` exposes -[`micromark`](https://wooorm.com/micromark-rs/micromark/fn.micromark.html), -[`micromark_with_options`](https://wooorm.com/micromark-rs/micromark/fn.micromark_with_options.html), -[`micromark_to_mdast`](https://wooorm.com/micromark-rs/micromark/fn.micromark_to_mdast.html), -[`Options`](https://wooorm.com/micromark-rs/micromark/struct.Options.html), +`markdown-rs` exposes +[`to_html`](https://wooorm.com/markdown-rs/markdown/fn.to_html.html), +[`to_html_with_options`](https://wooorm.com/markdown-rs/markdown/fn.to_html_with_options.html), +[`to_mdast`](https://wooorm.com/markdown-rs/markdown/fn.to_mdast.html), +[`Options`](https://wooorm.com/markdown-rs/markdown/struct.Options.html), and a few other structs and enums. See the [crate docs][docs] for more info. ## Extensions -micromark supports extensions to `CommonMark`. +`markdown-rs` supports extensions to `CommonMark`. These extensions are maintained in this project. They are not enabled by default but can be turned on with options. @@ -184,14 +181,14 @@ It’s instead a goal to support very common and mostly standardized extensions. ## Project -micromark is maintained as a single monolithic crate. +`markdown-rs` is maintained as a single monolithic crate. ### Overview The process to parse markdown looks like this: ```txt - micromark + markdown-rs +-------------------------------------------------+ | +-------+ +---------+--html- | | -markdown->+ parse +-events->+ compile + | @@ -204,7 +201,7 @@ The process to parse markdown looks like this: The files in `src/` are as follows: * `construct/*.rs` - — CommonMark, GFM, and other extension constructs used in micromark + — CommonMark, GFM, and other extension constructs used in markdown * `util/*.rs` — helpers often needed when parsing markdown * `event.rs` @@ -232,7 +229,7 @@ The files in `src/` are as follows: ### Test -micromark is tested with the \~650 CommonMark tests and more than 1k extra +`markdown-rs` is tested with the \~650 CommonMark tests and more than 1k extra tests confirmed with CM reference parsers. Then there’s even more tests for GFM and other extensions. These tests reach all branches in the code, which means that this project has @@ -264,12 +261,12 @@ The following bash scripts are useful when working on this project: * fuzz: ```sh cargo install cargo-fuzz - cargo +nightly fuzz run micromark + cargo +nightly fuzz run markdown ``` ### Version -micromark follows [SemVer](https://semver.org). +`markdown-rs` follows [SemVer](https://semver.org). ### Security @@ -277,7 +274,7 @@ The typical security aspect discussed for markdown is [cross-site scripting (XSS)][xss] attacks. Markdown itself is safe if it does not include embedded HTML or dangerous protocols in links/images (such as `javascript:` or `data:`). -micromark makes any markdown safe by default, even if HTML is embedded or +`markdown-rs` makes any markdown safe by default, even if HTML is embedded or dangerous protocols are used, as it encodes or drops them. Turning on the `allow_dangerous_html` or `allow_dangerous_protocol` options for user-provided markdown opens you up to XSS attacks. @@ -285,15 +282,15 @@ user-provided markdown opens you up to XSS attacks. An aspect related to XSS for security is syntax errors: markdown itself has no syntax errors. Some syntax extensions (specifically, only MDX) do include syntax errors. -For that reason, `micromark_with_options` returns `Result`, of +For that reason, `to_html_with_options` returns `Result`, of which the error is a simple string indicating where the problem happened, what occurred, and what was expected instead. Make sure to handle your errors when using MDX. Another security aspect is DDoS attacks. -For example, an attacker could throw a 100mb file at micromark, in which case -it’s going to take a long while to finish. -It is also possible to crash micromark with smaller payloads, notably when +For example, an attacker could throw a 100mb file at `markdown-rs`, in which +case it’s going to take a long while to finish. +It is also possible to crash `markdown-rs` with smaller payloads, notably when thousands of links, images, emphasis, or strong are opened but not closed. It is wise to cap the accepted size of input (500kb can hold a big book) and to process content in a different thread so that it can be stopped when needed. @@ -331,19 +328,19 @@ Special thanks go out to: - + - + - + - + -[docs]: https://wooorm.com/micromark-rs/micromark/ +[docs]: https://wooorm.com/markdown-rs/markdown/ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg -[chat]: https://github.com/wooorm/micromark-rs/discussions +[chat]: https://github.com/wooorm/markdown-rs/discussions [commonmark]: https://spec.commonmark.org @@ -357,7 +354,7 @@ Special thanks go out to: [chalker]: https://github.com/ChALkeR -[license]: https://github.com/micromark/micromark/blob/main/license +[license]: license [author]: https://wooorm.com diff --git a/src/lib.rs b/src/lib.rs index 365127f..dc429c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,15 +1,15 @@ -//! Public API of micromark. +//! Public API of `markdown-rs`. //! -//! This module exposes primarily [`micromark`][]. -//! It also exposes [`micromark_with_options`][] and [`micromark_to_mdast`][]. +//! This module exposes primarily [`to_html()`][]. +//! It also exposes [`to_html_with_options()`][] and [`to_mdast()`][]. //! -//! * [`micromark`][] +//! * [`to_html()`][] //! — safe way to transform (untrusted?) markdown into HTML -//! * [`micromark_with_options`][] -//! — like `micromark` but lets you configure how markdown is turned into -//! HTML, such as allowing dangerous HTML or turning on/off -//! different constructs (GFM, MDX, and the like) -//! * [`micromark_to_mdast`][] +//! * [`to_html_with_options()`][] +//! — like `to_html` but lets you configure how markdown is turned into +//! HTML, such as allowing dangerous HTML or turning on/off different +//! constructs (GFM, MDX, and the like) +//! * [`to_mdast()`][] //! — turn markdown into a syntax tree #![no_std] #![deny(clippy::pedantic)] @@ -37,8 +37,6 @@ mod util; use alloc::{boxed::Box, fmt, string::String}; use mdast::Node; use parser::parse; -use to_html::compile as to_html; -use to_mdast::compile as to_mdast; #[doc(hidden)] // Do not use: exported for quick prototyping, will be removed. @@ -60,7 +58,7 @@ pub use util::location::Location; /// ## Examples /// /// ``` -/// use micromark::LineEnding; +/// use markdown::LineEnding; /// # fn main() { /// /// // Use a CR + LF combination: @@ -128,7 +126,7 @@ impl LineEnding { pub enum MdxSignal { /// A syntax error. /// - /// `micromark-rs` will crash with error message `String`, and convert the + /// `markdown-rs` will crash with error message `String`, and convert the /// `usize` (byte offset into `&str` passed to `MdxExpressionParse` or /// `MdxEsmParse`) to where it happened in the whole document. /// @@ -140,7 +138,7 @@ pub enum MdxSignal { Error(String, usize), /// An error at the end of the (partial?) expression. /// - /// `micromark-rs` will either crash with error message `String` if it + /// `markdown-rs` will either crash with error message `String` if it /// doesn’t have any more text, or it will try again later when more text /// is available. /// @@ -152,7 +150,7 @@ pub enum MdxSignal { Eof(String), /// Done, successfully. /// - /// `micromark-rs` knows that this is the end of a valid expression/esm and + /// `markdown-rs` knows that this is the end of a valid expression/esm and /// continues with markdown. /// /// ## Examples @@ -213,7 +211,7 @@ pub type MdxExpressionParse = dyn Fn(&str, &MdxExpressionKind) -> MdxSignal; /// ## Examples /// /// ``` -/// use micromark::Constructs; +/// use markdown::Constructs; /// # fn main() { /// /// // Use the default trait to get `CommonMark` constructs: @@ -641,7 +639,7 @@ impl Constructs { /// ## Examples /// /// ``` -/// use micromark::CompileOptions; +/// use markdown::CompileOptions; /// # fn main() { /// /// // Use the default trait to get safe defaults: @@ -675,18 +673,18 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options}; + /// use markdown::{to_html, to_html_with_options, CompileOptions, Options}; /// # fn main() -> Result<(), String> { /// - /// // micromark is safe by default: + /// // `markdown-rs` is safe by default: /// assert_eq!( - /// micromark("Hi, venus!"), + /// to_html("Hi, venus!"), /// "

Hi, <i>venus</i>!

" /// ); /// /// // Turn `allow_dangerous_html` on to allow potentially dangerous HTML: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "Hi, venus!", /// &Options { /// compile: CompileOptions { @@ -719,18 +717,18 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options}; + /// use markdown::{to_html, to_html_with_options, CompileOptions, Options}; /// # fn main() -> Result<(), String> { /// - /// // micromark is safe by default: + /// // `markdown-rs` is safe by default: /// assert_eq!( - /// micromark(""), + /// to_html(""), /// "

javascript:alert(1)

" /// ); /// /// // Turn `allow_dangerous_protocol` on to allow potentially dangerous protocols: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "", /// &Options { /// compile: CompileOptions { @@ -750,8 +748,8 @@ pub struct CompileOptions { /// Default line ending to use when compiling to HTML, for line endings not /// in `value`. /// - /// Generally, micromark copies line endings (`\r`, `\n`, `\r\n`) in the - /// markdown document over to the compiled HTML. + /// Generally, `markdown-rs` copies line endings (`\r`, `\n`, `\r\n`) in + /// the markdown document over to the compiled HTML. /// In some cases, such as `> a`, CommonMark requires that extra line /// endings are added: `
\n

a

\n
`. /// @@ -763,18 +761,18 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, LineEnding, Options}; + /// use markdown::{to_html, to_html_with_options, CompileOptions, LineEnding, Options}; /// # fn main() -> Result<(), String> { /// - /// // micromark uses `\n` by default: + /// // `markdown-rs` uses `\n` by default: /// assert_eq!( - /// micromark("> a"), + /// to_html("> a"), /// "
\n

a

\n
" /// ); /// /// // Define `default_line_ending` to configure the default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "> a", /// &Options { /// compile: CompileOptions { @@ -805,12 +803,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// /// // `"Footnotes"` is used by default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options::gfm() /// )?, @@ -819,7 +817,7 @@ pub struct CompileOptions { /// /// // Pass `gfm_footnote_label` to use something else: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options { /// parse: ParseOptions::gfm(), @@ -850,12 +848,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// /// // `"h2"` is used by default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options::gfm() /// )?, @@ -864,7 +862,7 @@ pub struct CompileOptions { /// /// // Pass `gfm_footnote_label_tag_name` to use something else: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options { /// parse: ParseOptions::gfm(), @@ -898,12 +896,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// /// // `"class=\"sr-only\""` is used by default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options::gfm() /// )?, @@ -912,7 +910,7 @@ pub struct CompileOptions { /// /// // Pass `gfm_footnote_label_attributes` to use something else: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options { /// parse: ParseOptions::gfm(), @@ -941,12 +939,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// /// // `"Back to content"` is used by default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options::gfm() /// )?, @@ -955,7 +953,7 @@ pub struct CompileOptions { /// /// // Pass `gfm_footnote_back_label` to use something else: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options { /// parse: ParseOptions::gfm(), @@ -997,12 +995,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark, micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// /// // `"user-content-"` is used by default: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options::gfm() /// )?, @@ -1011,7 +1009,7 @@ pub struct CompileOptions { /// /// // Pass `gfm_footnote_clobber_prefix` to use something else: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "[^a]\n\n[^a]: b", /// &Options { /// parse: ParseOptions::gfm(), @@ -1041,12 +1039,12 @@ pub struct CompileOptions { /// ## Examples /// /// ``` - /// use micromark::{micromark_with_options, CompileOptions, Options, ParseOptions}; + /// use markdown::{to_html_with_options, CompileOptions, Options, ParseOptions}; /// # fn main() -> Result<(), String> { /// - /// // With `allow_dangerous_html`, micromark passes HTML through untouched: + /// // With `allow_dangerous_html`, `markdown-rs` passes HTML through untouched: /// assert_eq!( - /// micromark_with_options( + /// to_html_with_options( /// "