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

If div in html - html to quill won't render anything #1994

Closed
1 task done
HeropolisDa2ny opened this issue Jul 9, 2024 · 2 comments · Fixed by #1999
Closed
1 task done

If div in html - html to quill won't render anything #1994

HeropolisDa2ny opened this issue Jul 9, 2024 · 2 comments · Fixed by #1999
Labels
bug Something isn't working

Comments

@HeropolisDa2ny
Copy link

Is there an existing issue for this?

Flutter Quill version

flutter_quill: ^9.5.12 quill_html_converter: ^9.5.12 flutter_quill_extensions: ^9.5.12

Steps to reproduce

  1. Init the controller : final QuillController _controller = QuillController.basic();
  2. Init the document controller :
_controller.document = Document.fromDelta(
        Document.fromHtml('<html><body><div>Name : Test</div></body></html>')
            .toDelta());
  1. log(_controller.document.isEmpty().toString());
  2. Result: true

If we remove the div from the HTML it works fine. (but I need the divs)

Expected results

Screenshot 2024-07-09 at 9 34 01

Actual results

Screenshot 2024-07-09 at 9 34 08

Code sample

Code sample
final QuillController _controller = QuillController.basic(
    configurations: QuillControllerConfigurations(),
  );

  @override
  void initState() {
    _controller.document = Document.fromDelta(
      Document.fromHtml('<html><body><div>Name : Test</div></body></html>').toDelta(),
    );
    _controller.readOnly = false;

    log(_controller.document.toPlainText().toString());

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return QuillEditor.basic(
      configurations: QuillEditorConfigurations(
        controller: _controller,
        enableScribble: false,
        enableInteractiveSelection: false,
        sharedConfigurations: QuillSharedConfigurations(
          locale: Locale(Localizations.localeOf(context).languageCode),
        ),
        embedBuilders: kIsWeb
            ? FlutterQuillEmbeds.editorWebBuilders()
            : FlutterQuillEmbeds.editorBuilders(),
      ),
    );
  }

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]
@HeropolisDa2ny HeropolisDa2ny added the bug Something isn't working label Jul 9, 2024
@CatHood0
Copy link
Collaborator

CatHood0 commented Jul 9, 2024

@HeropolisDa2ny this isn't directly related with the package. The issue comes from flutter_quill_delta_from_html that not support <div> tags. At this moment there is a opened issue related with <div> and HTML elements wrapped within it issue

@CatHood0
Copy link
Collaborator

CatHood0 commented Jul 9, 2024

I already made a PR to resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants