flutter-quill icon indicating copy to clipboard operation
flutter-quill copied to clipboard

how to convert the flutter_quill textData with images into html with encoding the images into base64

Open rajcrack opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

The question

this is my used packages with flutter_quill_extensions: ^0.7.2 vsc_quill_delta_to_html: ^1.0.3, flutter_quill: ^8.6.4 ,

rajcrack avatar Dec 07 '23 09:12 rajcrack

Hi, there is already a package called quill_html_converter it uses vsc_quill_delta_to_html to convert the delta to HTML but the converting back from HTML to delta is experimental

EchoEllet avatar Dec 07 '23 12:12 EchoEllet

@ellet0 I don't think you answered @rajcrack's question. The quill_html_converter packages does convert the delta to html, however the toHtml() function doesn't convert the image file path to base64. This issue should be reopened.

alexrabin-sentracam avatar Mar 27 '24 16:03 alexrabin-sentracam

I haven't tested it, but it's just a long string and should be able to store it in the < img > image source

The question doesn't provide the details I needed.

For example, should we convert the images that's stored locally or on the network and then download it to convert it to base 64 in order to use it in the conversion process into Html?? Or maybe he meant an image that's is already base 64 in the quill delta

Html support is out of scope for now.

The source code is not in the best state.

EchoEllet avatar Mar 27 '24 17:03 EchoEllet

@ellet0 Yeah I write some code to convert the image file in local cache to base64 before user upload rich text to server. But it may be optional feat in flutter_quill_extensions.An other package quill_html_editor can covert image to base64 just select them.

toknT avatar Jun 21 '24 06:06 toknT