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

Update flutter_quill_delta_from_html in pubspec.yaml #1988

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Update flutter_quill_delta_from_html in pubspec.yaml #1988

merged 1 commit into from
Jul 8, 2024

Conversation

CatHood0
Copy link
Collaborator

@CatHood0 CatHood0 commented Jul 8, 2024

Description

I know that it was just a few hours ago that I added this dependency, however, I have updated it so that not only does it have better support for server-side conversions, but I also fixed certain errors and added better support for different attributes such as literals. align, or direction

For example, if in the current version you try to pass an HTML like:

<p align="center" >centered paragraph</p>

will come out:

[{"insert":"centered paragraph"},{"insert":"\n"}]

With version 1.2.1 it will be released:

[
 {"insert":"centered paragraph"},
 {"insert":"\n","attributes":{"align":"center"}},
 {"insert":"\n"}
]

Even in the current version (1.1.8) there is a problem with certain inline attributes, for example, if you use an HTML like:

<span style="line-height: 1.5px;font-size: 12px">word</span>

The output will be:

[
 {"insert":"word","attributes":{"line-height": "1.5px", "size": "12px"}},
 {"insert":"\n"}
]

Rather:

[
 {"insert":"word","attributes":{"line-height": 1.5, "size": "12"}},
 {"insert":"\n"}
]

And also added support for <p dir="rtl">direction</p> which would have an output similar to:

[
 {"insert":"Paragraph"},
 {"insert":"\n","attributes":{"direction":"rtl"}},
 {"insert":"\n"}
]

As you can see, version 1.2.1 fixes several problems that may bother several users and adds new attributes that can be useful if you do not always use inline attributes in the "style" of the html tags (<span style=" ...styles">)

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the package version in pubspec.yaml files.
  • All existing and new tests are passing.
  • I have run the commands in ./scripts/before_push.sh and it all passed successfully

Breaking Change

Does your PR require developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@CatHood0 CatHood0 requested a review from singerdmx July 8, 2024 01:03
@singerdmx singerdmx merged commit 127b35e into singerdmx:master Jul 8, 2024
2 checks passed
@CatHood0 CatHood0 deleted the fix_issues_with_delta_from_html branch July 11, 2024 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants