From be62b2e29a61774100f676cfdd9b100cadf1905f Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 30 Jun 2022 16:35:13 +0200 Subject: 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 --- tests/hard_break_escape.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/hard_break_escape.rs') diff --git a/tests/hard_break_escape.rs b/tests/hard_break_escape.rs index 2e3a3ba..c4f6f1d 100644 --- a/tests/hard_break_escape.rs +++ b/tests/hard_break_escape.rs @@ -9,12 +9,11 @@ fn hard_break_escape() { "should support a backslash to form a hard break" ); - // To do: trimming whitespace in paragraphs. - // assert_eq!( - // micromark("foo\\\n bar"), - // "

foo
\nbar

", - // "should support leading spaces after an escape hard break" - // ); + assert_eq!( + micromark("foo\\\n bar"), + "

foo
\nbar

", + "should support leading spaces after an escape hard break" + ); // To do: attention. // assert_eq!( -- cgit