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` --- tests/character_escape.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'tests/character_escape.rs') diff --git a/tests/character_escape.rs b/tests/character_escape.rs index c5c9004..0546269 100644 --- a/tests/character_escape.rs +++ b/tests/character_escape.rs @@ -1,7 +1,7 @@ -extern crate micromark; -use micromark::{ +extern crate markdown; +use markdown::{ mdast::{Node, Paragraph, Root, Text}, - micromark, micromark_to_mdast, micromark_with_options, + to_html, to_html_with_options, to_mdast, unist::Position, CompileOptions, Constructs, Options, ParseOptions, }; @@ -19,75 +19,75 @@ fn character_escape() -> Result<(), String> { }; assert_eq!( - micromark( + to_html( "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~"), "

!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

", "should support escaped ascii punctuation" ); assert_eq!( - micromark("\\→\\A\\a\\ \\3\\φ\\«"), + to_html("\\→\\A\\a\\ \\3\\φ\\«"), "

\\→\\A\\a\\ \\3\\φ\\«

", "should not support other characters after a backslash" ); assert_eq!( - micromark( + to_html( "\\*not emphasized*\n\\
not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity"), "

*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\n&ouml; not a character entity

", "should escape other constructs" ); assert_eq!( - micromark("foo\\\nbar"), + to_html("foo\\\nbar"), "

foo
\nbar

", "should escape a line break" ); assert_eq!( - micromark("`` \\[\\` ``"), + to_html("`` \\[\\` ``"), "

\\[\\`

", "should not escape in text code" ); assert_eq!( - micromark(" \\[\\]"), + to_html(" \\[\\]"), "
\\[\\]\n
", "should not escape in indented code" ); assert_eq!( - micromark(""), + to_html(""), "

http://example.com?find=\\*

", "should not escape in autolink" ); assert_eq!( - micromark_with_options("", &danger)?, + to_html_with_options("", &danger)?, "", "should not escape in flow html" ); assert_eq!( - micromark("[foo](/bar\\* \"ti\\*tle\")"), + to_html("[foo](/bar\\* \"ti\\*tle\")"), "

foo

", "should escape in resource and title" ); assert_eq!( - micromark("[foo]: /bar\\* \"ti\\*tle\"\n\n[foo]"), + to_html("[foo]: /bar\\* \"ti\\*tle\"\n\n[foo]"), "

foo

", "should escape in definition resource and title" ); assert_eq!( - micromark("``` foo\\+bar\nfoo\n```"), + to_html("``` foo\\+bar\nfoo\n```"), "
foo\n
", "should escape in fenced code info" ); assert_eq!( - micromark_with_options( + to_html_with_options( "\\> a", &Options { parse: ParseOptions { @@ -105,7 +105,7 @@ fn character_escape() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("a \\* b", &ParseOptions::default())?, + to_mdast("a \\* b", &ParseOptions::default())?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![Node::Text(Text { -- cgit