Open muzimuzhi opened 1 year ago
$ echo '<code>x</code> <code>y</code>' | htmlq -p body <body><code>x</code><code>y</code> </body>%
Here "blank" text node means a text node contains only whitespaces.
Since <code>x</code> <code>y</code> and <code>x</code><code>y</code> give different rendering output, htmlq changes the semantic of this HTML snippet.
<code>x</code> <code>y</code>
<code>x</code><code>y</code>
htmlq
It seems the condition on line 70 (see code snippet below) is too loose. Not sure if self.previous_was_block && text.trim().is_empty() is enough. https://github.com/mgdm/htmlq/blob/739cd363543cd5c36a2d7bcbbb3ab7e811205611/src/pretty_print.rs#L69-L81
self.previous_was_block && text.trim().is_empty()
Here "blank" text node means a text node contains only whitespaces.
Since
<code>x</code> <code>y</code>
and<code>x</code><code>y</code>
give different rendering output,htmlq
changes the semantic of this HTML snippet.It seems the condition on line 70 (see code snippet below) is too loose. Not sure if
self.previous_was_block && text.trim().is_empty()
is enough. https://github.com/mgdm/htmlq/blob/739cd363543cd5c36a2d7bcbbb3ab7e811205611/src/pretty_print.rs#L69-L81