aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc_tabs.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/misc_tabs.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/misc_tabs.rs66
1 files changed, 30 insertions, 36 deletions
diff --git a/tests/misc_tabs.rs b/tests/misc_tabs.rs
index e9a0b72..568172e 100644
--- a/tests/misc_tabs.rs
+++ b/tests/misc_tabs.rs
@@ -221,48 +221,42 @@ fn tabs_text() {
// "should support an initial tab after a line ending in a paragraph"
// );
- // To do: link (reference).
- // assert_eq!(
- // micromark("x[\ty](z)"),
- // "<p>x<a href=\"z\">\ty</a></p>",
- // "should support an initial tab in a link label"
- // );
+ assert_eq!(
+ micromark("x[\ty](z)"),
+ "<p>x<a href=\"z\">\ty</a></p>",
+ "should support an initial tab in a link label"
+ );
- // To do: link (reference).
- // assert_eq!(
- // micromark("x[y\t](z)"),
- // "<p>x<a href=\"z\">y\t</a></p>",
- // "should support a final tab in a link label"
- // );
+ assert_eq!(
+ micromark("x[y\t](z)"),
+ "<p>x<a href=\"z\">y\t</a></p>",
+ "should support a final tab in a link label"
+ );
- // To do: link (reference).
- // assert_eq!(
- // micromark("[x\ty](z)"),
- // "<p><a href=\"z\">x\ty</a></p>",
- // "should support a tab in a link label"
- // );
+ assert_eq!(
+ micromark("[x\ty](z)"),
+ "<p><a href=\"z\">x\ty</a></p>",
+ "should support a tab in a link label"
+ );
- // To do: link (resource).
// Note: CM.js bug, see: <https://github.com/commonmark/commonmark.js/issues/191>
- // assert_eq!(
- // micromark("[x](\ty)"),
- // "<p><a href=\"y\">x</a></p>",
- // "should support a tab starting a link resource"
- // );
+ assert_eq!(
+ micromark("[x](\ty)"),
+ "<p><a href=\"y\">x</a></p>",
+ "should support a tab starting a link resource"
+ );
- // To do: link (resource).
- // assert_eq!(
- // micromark("[x](y\t)"),
- // "<p><a href=\"y\">x</a></p>",
- // "should support a tab ending a link resource"
- // );
+ assert_eq!(
+ micromark("[x](y\t)"),
+ "<p><a href=\"y\">x</a></p>",
+ "should support a tab ending a link resource"
+ );
- // To do: link (resource).
- // assert_eq!(
- // micromark("[x](y\t\"z\")"),
- // "<p><a href=\"y\" title=\"z\">x</a></p>",
- // "should support a tab between a link destination and title"
- // );
+ assert_eq!(
+ micromark("[x](y\t\"z\")"),
+ "<p><a href=\"y\" title=\"z\">x</a></p>",
+ "should support a tab between a link destination and title"
+ );
}
#[test]