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

Question: is possible to convert HTML to QUILL? #7

Open
oferRounds opened this issue Apr 17, 2019 · 3 comments
Open

Question: is possible to convert HTML to QUILL? #7

oferRounds opened this issue Apr 17, 2019 · 3 comments

Comments

@oferRounds
Copy link

oferRounds commented Apr 17, 2019

i.e., not quill delta, but actual quill string

@oferRounds oferRounds changed the title Question: is possible to convert HTML to QUIL? Question: is possible to convert HTML to QUILL? Apr 17, 2019
@joelcolucci
Copy link
Owner

Hi @oferRounds, Thanks for reaching out.

Are you able to provide an example of desired input and desired output?

I'm happy to look into this.

@oferRounds
Copy link
Author

@joelcolucci I’m sorry for the delay on my side!

Maybe I’m missing something, QUILL is different than HTML, right? my backend expect to receive a QUILL for some feature we have, and my rich-text-editor creates an HTML. So I’m looking for a solution to covert the data before sending it to the backend.

Am I making sense here?

Thanks again for replying!

@joelcolucci
Copy link
Owner

joelcolucci commented Feb 1, 2020

Hi @oferRounds ,

It sounds like you may be looking for one of the methods this package supports.

Example:

const { convertHtmlToDelta } = require('node-quill-converter');

const htmlString = '<p>hello, <strong>world</strong></p>';
const delta = convertHtmlToDelta(htmlString);

Note, I believe Quill, by default, provides the delta format which is JSON serializable. Your client could send the serialized delta down to the server, store it, and return it to the client when needed.

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

No branches or pull requests

2 participants