Fix empty Text event emitted with trim_text_end (#984) - #997
Conversation
When trim_text_end is enabled, whitespace-only text before markup or
a reference is now suppressed instead of producing an empty Text("") event.
closes tafia#984
The comment claimed `<` was consumed, but `read_text` never consumes it, `<` is consumed later by `read_with` inside `read_until_close`.
| $self.config_mut().trim_text_start = trim; | ||
| let config = $self.config_mut(); | ||
| config.trim_text_start = trim_start; | ||
| config.trim_text_end = trim_end; |
There was a problem hiding this comment.
I don't really like the clear->restore pattern, but it was already like this. Would be nice to refactor this away
There was a problem hiding this comment.
Yes, I also does not like it here... I was thinking about removing auto-trim altogether and making it an explicit method call on the Event
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #997 +/- ##
==========================================
- Coverage 57.31% 56.09% -1.22%
==========================================
Files 46 47 +1
Lines 18197 18429 +232
==========================================
- Hits 10429 10338 -91
- Misses 7768 8091 +323
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
When trim_text_end is enabled, whitespace-only text before markup or a reference is now suppressed instead of producing an empty Text("") event.
closes #984