aboutsummaryrefslogtreecommitdiffstats
path: root/tests/image.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 16:35:13 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-30 16:35:13 +0200
commitbe62b2e29a61774100f676cfdd9b100cadf1905f (patch)
tree4349e259fc0150526dc32242b92d85218091fca5 /tests/image.rs
parent13588776d65601a41ddfce85f618e8aaa55951cc (diff)
downloadmarkdown-rs-be62b2e29a61774100f676cfdd9b100cadf1905f.tar.gz
markdown-rs-be62b2e29a61774100f676cfdd9b100cadf1905f.tar.bz2
markdown-rs-be62b2e29a61774100f676cfdd9b100cadf1905f.zip
Add support for trimming whitespace around string, text
This commit introduces trimming initial and final whitespace around the whole string or text, or around line endings inside that string or text. * Add `register_resolver_before`, to run resolvers earlier than others, used for labels * Add resolver to merge `data` events, which are the most frequent token that occurs, and can happen adjacently. In `micromark-js` this sped up parsing a lot * Fix a bug where a virtual space was not seen as an okay event * Refactor to enable all turned off whitespace tests
Diffstat (limited to '')
-rw-r--r--tests/image.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/image.rs b/tests/image.rs
index 68b9717..6db6d75 100644
--- a/tests/image.rs
+++ b/tests/image.rs
@@ -102,12 +102,11 @@ fn image() {
"should support case-insensitive labels"
);
- // To do: trim paragraphs.
- // assert_eq!(
- // micromark("[foo]: /url \"title\"\n\n![foo] \n[]"),
- // "<p><img src=\"/url\" alt=\"foo\" title=\"title\" />\n[]</p>",
- // "should not support whitespace between sets of brackets"
- // );
+ assert_eq!(
+ micromark("[foo]: /url \"title\"\n\n![foo] \n[]"),
+ "<p><img src=\"/url\" alt=\"foo\" title=\"title\" />\n[]</p>",
+ "should not support whitespace between sets of brackets"
+ );
assert_eq!(
micromark("[foo]: /url \"title\"\n\n![foo]"),