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 on pubspec.yaml to fix current issues #1999

Merged

Conversation

CatHood0
Copy link
Collaborator

@CatHood0 CatHood0 commented Jul 9, 2024

Description

In the current version of flutter_quill_delta_from_html (1.2.1) html is not supported within a <div> and there are even errors during the parsing of the font-size to a valid value for flutter_quill.

With this new version the inclusion of <div> is officially in the package for HTML like this:

<div><p>Text</p></div>

Will converted on:

{"insert":"Text"},
{"insert":"\n"}

And an important point was fixed, which is the parsing of the font-size and line-height, where if before we used values ​​like: rem, em, pc, pt, etc. the editor threw errors because those values ​​were not valid referenced in this comment:

Previously if we had a:

<p style="font-size: 0.75em">Text</p>

The parsing to Delta was:

{"insert":"Text","attributes":{"size":"0.75"}},
{"insert":"\n"}

Which caused errors in the rendering. Now, with the addition of parsing and calculation based on the unit type, the Delta will have an output such that:

{"insert":"Text","attributes":{"size":"small"}},
{"insert":"\n"}

The default values: 0.75em, 1.5em, and 2.5em will be equivalent to: small, large and huge

Related Issues

Fix #1994
Fix #1990 (comment)

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.

@singerdmx singerdmx merged commit 3078b26 into singerdmx:master Jul 9, 2024
2 checks passed
@CatHood0 CatHood0 deleted the fix_flutter_html_to_delta_issues branch July 10, 2024 01:24
EchoEllet pushed a commit that referenced this pull request Jul 10, 2024
Co-authored-by: CatHood0 <santiagowmar@gmail.com>
@CatHood0 CatHood0 restored the fix_flutter_html_to_delta_issues branch July 11, 2024 01:43
@CatHood0 CatHood0 deleted the fix_flutter_html_to_delta_issues 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.

If div in html - html to quill won't render anything
2 participants