[BUG] `<p> </p>` does not create empty space from `3.0.0-beta.2`
Describe the bug:
<p> </p> should create space, but starting from version 3.0.0-beta.2 it is ignored. It works properly in version 3.0.0-beta.1
HTML to reproduce the issue:
<p>Paragraph before nbsp<\p><p> <p/><p>Paragraph after nbsp<\p>
Html widget configuration:
Html(
data:
"<p>Paragraph before nbsp<\p><p> <p/><p>Paragraph after nbsp<\p>",
style: {
'p': Style(margin: Margins.all(0)),
},
),
Expected behavior: It should create empty space.
Screenshots:
Screen using version 3.0.0-beta.2 |
Screen using version 3.0.0-beta.1 |
|---|---|
Device details and Flutter/Dart/flutter_html versions:
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (3 miesiące temu) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3
Currently the whitespace.dart file removes the   treating it as a whitespace, and then removes the now-empty p element:
https://github.com/Sub6Resources/flutter_html/blob/79ec194fa6690e5caba58f5eca04e6748394bb6b/lib/src/processing/whitespace.dart#L16-L17
That's not consistent with how browsers treat such paragraphs. An empty paragraph with a non-breakable space is often used by WYSIWYG editors in CMSes for empty spaces.
I agree. This is probably related to #1440 and the html parser taking nbsp processing into its own hands