aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 12:49:55 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 12:49:55 +0200
commitbf9460fddeec7366df117ddae13b7d31d3354313 (patch)
treeaa29606a51cf464590cca88b35ee83041bb6a2f6 /tests
parentb0bc9ea9b5f5bf8a5c2f33b1102abf4f649e60c7 (diff)
downloadmarkdown-rs-bf9460fddeec7366df117ddae13b7d31d3354313.tar.gz
markdown-rs-bf9460fddeec7366df117ddae13b7d31d3354313.tar.bz2
markdown-rs-bf9460fddeec7366df117ddae13b7d31d3354313.zip
Add support for stripping tags in image `alt`
Diffstat (limited to '')
-rw-r--r--tests/heading_setext.rs8
-rw-r--r--tests/image.rs32
-rw-r--r--tests/link_resource.rs11
3 files changed, 24 insertions, 27 deletions
diff --git a/tests/heading_setext.rs b/tests/heading_setext.rs
index 92a5b43..ecf22a8 100644
--- a/tests/heading_setext.rs
+++ b/tests/heading_setext.rs
@@ -3,28 +3,28 @@ use micromark::micromark;
#[test]
fn heading_setext() {
- // To do: emphasis.
+ // To do: attention.
// assert_eq!(
// micromark("Foo *bar*\n========="),
// "<h1>Foo <em>bar</em></h1>",
// "should support a heading w/ an equals to (rank of 1)"
// );
- // To do: emphasis.
+ // To do: attention.
// assert_eq!(
// micromark("Foo *bar*\n---------"),
// "<h2>Foo <em>bar</em></h2>",
// "should support a heading w/ a dash (rank of 2)"
// );
- // To do: emphasis.
+ // To do: attention.
// assert_eq!(
// micromark("Foo *bar\nbaz*\n===="),
// "<h1>Foo <em>bar\nbaz</em></h1>",
// "should support line endings in setext headings"
// );
- // To do: emphasis, trim.
+ // To do: attention, trim.
// assert_eq!(
// micromark(" Foo *bar\nbaz*\t\n===="),
// "<h1>Foo <em>bar\nbaz</em></h1>",
diff --git a/tests/image.rs b/tests/image.rs
index 9be056f..68b9717 100644
--- a/tests/image.rs
+++ b/tests/image.rs
@@ -14,35 +14,33 @@ fn image() {
"should support image w/ resource"
);
- // To do: attention, tags in images.
+ // To do: attention.
// assert_eq!(
// micromark("[foo *bar*]: train.jpg \"train & tracks\"\n\n![foo *bar*]"),
// "<p><img src=\"train.jpg\" alt=\"foo bar\" title=\"train &amp; tracks\" /></p>",
// "should support image as shortcut reference"
// );
- // To do: tags in images.
- // assert_eq!(
- // micromark("![foo ![bar](/url)](/url2)"),
- // "<p><img src=\"/url2\" alt=\"foo bar\" /></p>",
- // "should “support” images in images"
- // );
+ assert_eq!(
+ micromark("![foo ![bar](/url)](/url2)"),
+ "<p><img src=\"/url2\" alt=\"foo bar\" /></p>",
+ "should “support” images in images"
+ );
- // To do: tags in images.
- // assert_eq!(
- // micromark("![foo [bar](/url)](/url2)"),
- // "<p><img src=\"/url2\" alt=\"foo bar\" /></p>",
- // "should “support” links in images"
- // );
+ assert_eq!(
+ micromark("![foo [bar](/url)](/url2)"),
+ "<p><img src=\"/url2\" alt=\"foo bar\" /></p>",
+ "should “support” links in images"
+ );
- // To do: attention, tags in images.
+ // To do: attention.
// assert_eq!(
// micromark("[foo *bar*]: train.jpg \"train & tracks\"\n\n![foo *bar*][]"),
// "<p><img src=\"train.jpg\" alt=\"foo bar\" title=\"train &amp; tracks\" /></p>",
// "should support “content” in images"
// );
- // To do: attention, tags in images.
+ // To do: attention.
// assert_eq!(
// micromark("[FOOBAR]: train.jpg \"train & tracks\"\n\n![foo *bar*][foobar]"),
// "<p><img src=\"train.jpg\" alt=\"foo bar\" title=\"train &amp; tracks\" /></p>",
@@ -91,7 +89,7 @@ fn image() {
"should support collapsed references (1)"
);
- // To do: attention, tags in images.
+ // To do: attention.
// assert_eq!(
// micromark("[*foo* bar]: /url \"title\"\n\n![*foo* bar][]"),
// "<p><img src=\"/url\" alt=\"foo bar\" title=\"title\" /></p>",
@@ -117,7 +115,7 @@ fn image() {
"should support shortcut references (1)"
);
- // To do: attention, tags in images.
+ // To do: attention.
// assert_eq!(
// micromark("[*foo* bar]: /url \"title\"\n\n![*foo* bar]"),
// "<p><img src=\"/url\" alt=\"foo bar\" title=\"title\" /></p>",
diff --git a/tests/link_resource.rs b/tests/link_resource.rs
index 992c7d2..d75736e 100644
--- a/tests/link_resource.rs
+++ b/tests/link_resource.rs
@@ -257,12 +257,11 @@ fn link_resource() {
// "should not support links in links (2)"
// );
- // To do: tags in images.
- // assert_eq!(
- // micromark("![[[foo](uri1)](uri2)](uri3)"),
- // "<p><img src=\"uri3\" alt=\"[foo](uri2)\" /></p>",
- // "should not support links in links (3)"
- // );
+ assert_eq!(
+ micromark("![[[foo](uri1)](uri2)](uri3)"),
+ "<p><img src=\"uri3\" alt=\"[foo](uri2)\" /></p>",
+ "should not support links in links (3)"
+ );
assert_eq!(
micromark("*[foo*](/uri)"),