aboutsummaryrefslogtreecommitdiffstats
path: root/tests/character_reference.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-24 17:57:10 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-24 17:57:10 +0200
commita3dd207e3b1ebcbcb6cec0f703a695e51ae4ece0 (patch)
tree7b4bf040da23a03f38efe92a252e187a630a14f6 /tests/character_reference.rs
parente7b3761c8cd6f0f902dd9927e4fbf2589465ed57 (diff)
downloadmarkdown-rs-a3dd207e3b1ebcbcb6cec0f703a695e51ae4ece0.tar.gz
markdown-rs-a3dd207e3b1ebcbcb6cec0f703a695e51ae4ece0.tar.bz2
markdown-rs-a3dd207e3b1ebcbcb6cec0f703a695e51ae4ece0.zip
Add link, images (resource)
This is still some messy code that needs cleaning up, but it adds support for links and images, of the resource kind (`[a](b)`). References (`[a][b]`) are parsed and will soon be supported, but need matching. * Fix bug to pad percent-encoded bytes when normalizing urls * Fix bug with escapes counting as balancing in destination * Add `space_or_tab_one_line_ending`, to parse whitespace including up to one line ending (but not a blank line) * Add `ParserState` to share codes, definitions, etc
Diffstat (limited to '')
-rw-r--r--tests/character_reference.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/character_reference.rs b/tests/character_reference.rs
index 136ce17..3d2111e 100644
--- a/tests/character_reference.rs
+++ b/tests/character_reference.rs
@@ -55,14 +55,13 @@ fn character_reference() {
"should not care about character references in html"
);
- // To do: link (resource).
- // assert_eq!(
- // micromark("[foo](/f&ouml;&ouml; \"f&ouml;&ouml;\")"),
- // "<p><a href=\"/f%C3%B6%C3%B6\" title=\"föö\">foo</a></p>",
- // "should support character references in resource URLs and titles"
- // );
+ assert_eq!(
+ micromark("[foo](/f&ouml;&ouml; \"f&ouml;&ouml;\")"),
+ "<p><a href=\"/f%C3%B6%C3%B6\" title=\"föö\">foo</a></p>",
+ "should support character references in resource URLs and titles"
+ );
- // To do: link (resource).
+ // To do: link (reference).
// assert_eq!(
// micromark("[foo]: /f&ouml;&ouml; \"f&ouml;&ouml;\"\n\n[foo]"),
// "<p><a href=\"/f%C3%B6%C3%B6\" title=\"föö\">foo</a></p>",
@@ -101,12 +100,11 @@ fn character_reference() {
// "should not support character references as construct markers (2)"
// );
- // To do: link (resource).
- // assert_eq!(
- // micromark("[a](url &quot;tit&quot;)"),
- // "<p>[a](url &quot;tit&quot;)</p>",
- // "should not support character references as construct markers (3)"
- // );
+ assert_eq!(
+ micromark("[a](url &quot;tit&quot;)"),
+ "<p>[a](url &quot;tit&quot;)</p>",
+ "should not support character references as construct markers (3)"
+ );
assert_eq!(
micromark("foo&#10;&#10;bar"),