-
Notifications
You must be signed in to change notification settings - Fork 97
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
QuillDeltaToHtmlConverter returns blank #93
Comments
I'm having the same issue. Converter rawDeltaOps shows result similar to yours but the convert() function returns blank.
|
I have the same issue, any news about this bug ? |
Are you using React? If so, I found a workaround:
|
I often stumbled over this… don't supply the const QuillDeltaToHtmlConverter = require('quill-delta-to-html').QuillDeltaToHtmlConverter;
jobs.forEach(job => {
const cfg = {};
const cfg2 = {};
const converterDesc = new QuillDeltaToHtmlConverter(job.info.description.ops);
const converterReq = new QuillDeltaToHtmlConverter(job.info.requirements.ops);
job.info.description = converterDesc.convert();
job.info.requirements = converterReq.convert();
}); I don't know why you are using |
typescript + react . Works fine! import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html';
const cfg = {};
function deltaToHtml(delta: string) {
const _delta = JSON.parse(delta);
const converter = new QuillDeltaToHtmlConverter(_delta.ops, cfg);
const html = converter.convert();
return html;
...
<div dangerouslySetInnerHTML={{ __html: quillToHtml(data) }} /> |
What I did forget was to first make a JSON object of the String I got from the database with |
I am currently fetching delta data from my database and using convert() to convert the delta value to HTML. For some reason, the value returns a blank string but before convert() the object was assigned delta. What could be the issue?
EXAMPLE:
const QuillDeltaToHtmlConverter = require('quill-delta-to-html').QuillDeltaToHtmlConverter;
jobs.forEach(job => {
const cfg = {};
const cfg2 = {};
const converterDesc = new QuillDeltaToHtmlConverter(job.info.description.toString());
const converterReq = new QuillDeltaToHtmlConverter(job.info.requirements.toString());
job.info.description = converterDesc.convert();
job.info.requirements = converterReq.convert();
});
converterDesc contains this before I call the convert() function:
rawDeltaOps:'{"ops":[{"attributes":{"bold":true},"insert":"Looking for Independent and Growth Mindset Designer"},{"insert":"\nLooking for UI/UX designs to assist our team to support black businesses in becoming digital resilient. Our team consult with startups and small business and offer services to design & develop their digital solution.\n\n"}]}'
I tried without toString()
The text was updated successfully, but these errors were encountered: