aboutsummaryrefslogtreecommitdiffstats
path: root/tests/link_reference.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-04 12:16:51 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-04 12:16:58 +0200
commitfaca28020f4894bdfcf5a4b164ebbc75864d8776 (patch)
tree93377413ae8c355e2d804f7e700241693b228e70 /tests/link_reference.rs
parente1cae8c705e66669d043f5269e9f58c09c7b0eaa (diff)
downloadmarkdown-rs-faca28020f4894bdfcf5a4b164ebbc75864d8776.tar.gz
markdown-rs-faca28020f4894bdfcf5a4b164ebbc75864d8776.tar.bz2
markdown-rs-faca28020f4894bdfcf5a4b164ebbc75864d8776.zip
Add support for attention (emphasis, strong)
Diffstat (limited to 'tests/link_reference.rs')
-rw-r--r--tests/link_reference.rs68
1 files changed, 33 insertions, 35 deletions
diff --git a/tests/link_reference.rs b/tests/link_reference.rs
index 372bea5..3a0be9f 100644
--- a/tests/link_reference.rs
+++ b/tests/link_reference.rs
@@ -27,7 +27,7 @@ fn link_reference() {
"should support escaped brackets in link references"
);
- // To do: attention.
+ // To do: link/attention interplay.
// assert_eq!(
// micromark("[ref]: /uri\n\n[link *foo **bar** `#`*][ref]"),
// "<p><a href=\"/uri\">link <em>foo <strong>bar</strong> <code>#</code></em></a></p>",
@@ -46,19 +46,19 @@ fn link_reference() {
"should not support links in link references"
);
- // To do: attention.
- // assert_eq!(
- // micromark("[ref]: /uri\n\n[foo *bar [baz][ref]*][ref]"),
- // "<p>[foo <em>bar <a href=\"/uri\">baz</a></em>]<a href=\"/uri\">ref</a></p>",
- // "should not support deep links in link references"
- // );
-
assert_eq!(
- micromark("[ref]: /uri\n\n*[foo*][ref]"),
- "<p>*<a href=\"/uri\">foo*</a></p>",
- "should prefer link references over emphasis (1)"
+ micromark("[ref]: /uri\n\n[foo *bar [baz][ref]*][ref]"),
+ "<p>[foo <em>bar <a href=\"/uri\">baz</a></em>]<a href=\"/uri\">ref</a></p>",
+ "should not support deep links in link references"
);
+ // To do: link/attention interplay.
+ // assert_eq!(
+ // micromark("[ref]: /uri\n\n*[foo*][ref]"),
+ // "<p>*<a href=\"/uri\">foo*</a></p>",
+ // "should prefer link references over emphasis (1)"
+ // );
+
assert_eq!(
micromark("[ref]: /uri\n\n[foo *bar][ref]"),
"<p><a href=\"/uri\">foo *bar</a></p>",
@@ -173,12 +173,11 @@ fn link_reference() {
"should support collaped references"
);
- // To do: attention.
- // assert_eq!(
- // micromark("[*foo* bar]: /url \"title\"\n\n[*foo* bar][]"),
- // "<p><a href=\"/url\" title=\"title\"><em>foo</em> bar</a></p>",
- // "should support content in collaped references"
- // );
+ assert_eq!(
+ micromark("[*foo* bar]: /url \"title\"\n\n[*foo* bar][]"),
+ "<p><a href=\"/url\" title=\"title\"><em>foo</em> bar</a></p>",
+ "should support content in collaped references"
+ );
assert_eq!(
micromark("[foo]: /url \"title\"\n\n[Foo][]"),
@@ -198,19 +197,17 @@ fn link_reference() {
"should support shortcut references"
);
- // To do: attention.
- // assert_eq!(
- // micromark("[*foo* bar]: /url \"title\"\n\n[*foo* bar]"),
- // "<p><a href=\"/url\" title=\"title\"><em>foo</em> bar</a></p>",
- // "should support content in shortcut references (1)"
- // );
+ assert_eq!(
+ micromark("[*foo* bar]: /url \"title\"\n\n[*foo* bar]"),
+ "<p><a href=\"/url\" title=\"title\"><em>foo</em> bar</a></p>",
+ "should support content in shortcut references (1)"
+ );
- // To do: attention.
- // assert_eq!(
- // micromark("[*foo* bar]: /url \"title\"\n\n[[*foo* bar]]"),
- // "<p>[<a href=\"/url\" title=\"title\"><em>foo</em> bar</a>]</p>",
- // "should support content in shortcut references (2)"
- // );
+ assert_eq!(
+ micromark("[*foo* bar]: /url \"title\"\n\n[[*foo* bar]]"),
+ "<p>[<a href=\"/url\" title=\"title\"><em>foo</em> bar</a>]</p>",
+ "should support content in shortcut references (2)"
+ );
assert_eq!(
micromark("[foo]: /url\n\n[[bar [foo]"),
@@ -236,11 +233,12 @@ fn link_reference() {
"should “support” an escaped shortcut reference"
);
- assert_eq!(
- micromark("[foo*]: /url\n\n*[foo*]"),
- "<p>*<a href=\"/url\">foo*</a></p>",
- "should prefer shortcut references over emphasis"
- );
+ // To do: link/attention interplay.
+ // assert_eq!(
+ // micromark("[foo*]: /url\n\n*[foo*]"),
+ // "<p>*<a href=\"/url\">foo*</a></p>",
+ // "should prefer shortcut references over emphasis"
+ // );
assert_eq!(
micromark("[foo]: /url1\n[bar]: /url2\n\n[foo][bar]"),
@@ -338,7 +336,7 @@ fn link_reference() {
"should not support mismatched character references in fulls"
);
- // To do: attention.
+ // To do: link/attention interplay.
// assert_eq!(
// micromark(
// "[*f*][]