-
-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Html and SelectableHtml treat some opening and closing html tag elements as new lines and adds white space in the generated widget #1146
Comments
I believe the whitespace issues have been resolved on the master branch. We're hoping to push out a new release, 3.0.0-alpha.6 that contains these changes. If this is blocking, you can try using this library from the master branch until the next release comes. |
Hi @Sub6Resources , do you have any rough estimation on when you are going to release it? |
@ValentinVignal I've been pushing through some blocking pull requests today, so within the next few days hopefully. I'm getting married in a couple weeks so I'm pretty busy. |
@Sub6Resources Nice! Congratulation! 💍 🎉 |
Thanks! The new version of the core library has been pushed to 3.0.0-alpha.6. The subpackages are still waiting to be released. Will you verifiy that this fixed your issue @zilvis97 and @ValentinVignal? |
@Sub6Resources Sorry for late reply, I have just checked on my app with |
Confirmed still bug present in Example rendered, when there are no leading spaces in HTML. Typically there is a new line (but no space) in HTML between the HTML h3 tag in this case before text begins. |
Same problem in flutter_html: ^3.0.0-alpha.6. |
I believe I found a related bug. New lines are added for each <div> element. If the <div> is nested in a tree, new lines are added at the end of the tree. The lines causing the issue seem to be here: flutter_html/lib/custom_render.dart Line 140 in 4225935
and here: flutter_html/lib/custom_render.dart Line 147 in 4225935
Please see the reproduction here: https://github.com/m-skolnick/flutter_html_test/blob/main/README.md Offending html string
|
@Sub6Resources It looks like it's been a few months since there were updates. Just curious if this is a package you're still actively maintaining. Thank you for this package! It's been great so far! |
@m-skolnick Yup, still maintaining! Just got sidelined for a bit. See #1247. Thanks for getting to the root of this issue! |
Describe the bug:
Every closing div tag and some opening div tags acts as a new line element if they are formatted as a proper HTML. If we put all the closing tags into one line, the whitespace disappears.
I tried to apply
display: Display.INLINE_BLOCK,
or some other display type to div tags, it kind of solves this issue, but then it clutters all the text into one without being able to see any paragraphs, also the alignment becomes weird with some paragraphs having some leading spaces before the start, even that is not consistent as some paragraph would have 1 leading space, some would have 2 or 3.HTML to reproduce the issue:
Html
widget configuration:Html(data: htmlData)
Expected behavior:
Should be no whitespace for every closing tag between the text
Screenshots:
Device details and Flutter/Dart/
flutter_html
versions:Stacktrace/Logcat
flutter_html: ^3.0.0-alpha.5
Additional info:
If we put all the divs together in one line with no spaces/lines separated:
it will format the text more like expected:
A picture of a cute animal (not mandatory but encouraged)
The text was updated successfully, but these errors were encountered: