Skip to content
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

removeUnnecessaryWhitespace should remove leading and trailing spaces #347

Closed
sgara opened this issue Jul 8, 2020 · 6 comments · Fixed by #398 or #574
Closed

removeUnnecessaryWhitespace should remove leading and trailing spaces #347

sgara opened this issue Jul 8, 2020 · 6 comments · Fixed by #398 or #574

Comments

@sgara
Copy link
Contributor

sgara commented Jul 8, 2020

Hi!
First of all, thanks for this lib!
I'm just seeing a minor issue where leading (and trailing) spaces are not being removed although - as I understand it - they should be.

Simple example:
When parsing indented html document such as:

<div>
  content
</div>

Equivalent string rendered in flutter:

Html(data: "<div>\n  content\n</div>");

The resulting string gives me " content " but should be "content"

Edit: forgot to mention version! I'm using "1.0.0"

@hotlittlewhitedog
Copy link

hotlittlewhitedog commented Jul 8, 2020

I also have the save problem of extra leading space (v1.0.0).
Please solve it guys :)

Examples:
<h1>My header</h1>- line 1<br>- line 2<br>

Look also at your screenshot, you will see there is an extra space in front of all options 1.

@LucasJunioRG
Copy link

Same problem here (v1.0.0)

I'm using the html widget on a ListView builder and its adding spaces which breaks my list :/

Screenshot_1

@Pherne
Copy link

Pherne commented Sep 3, 2020

I have the same issue. I'm just using a p-tag. Using the whiteSpace attribute of the Style class didn't help.

Why are there no replies, yet? Is this an easily solved issue on our part? Because I couldn't find anything helpful online (maybe I just looked for the wrong thing) and I don't know how to solve this.
Screenshot_1599138322

@hotlittlewhitedog
Copy link

hotlittlewhitedog commented Sep 3, 2020 via email

@Pherne
Copy link

Pherne commented Sep 4, 2020

@hotlittlewhitedog Thanks, that worked.

I'm just not very satisfied with this solution because it seems I'm missing some newer features now. I just hope the devs can get to this in the not too far future.

@glowinthedark
Copy link

glowinthedark commented Dec 8, 2020

@sgara:

With the current master branch a block such as

<p>    The objective of this..</p>

is rendered with the first character in the paragraph indented by one character as can be seen in the screenshot:

image

As you can see above The is not left aligned with the text on the second line and has a preceding space character.

I used the following declaration in pubspec.yaml:

dependencies:
  flutter_html:
    git:
      url: https://github.com/Sub6Resources/flutter_html.git
      ref: master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants