Custom HTML that retains styles into default value props ReactQuill Component?
CalaisFr opened this issue · 2 comments
Hello, my problem is relatively straight forward but I cannot find any info on populating Quill Editor with custom templates with custom styles.
I basically want my Quill Editor to populate with a template consisting of an image at full width and a respectable height, and a div bar below it that contains two pieces of basic string data. So Basically one div tag with a few embedded divs and img tag.
So wondering if there are ways to have complex default values, or is this something I should rather keep outside of the editor ?
I have tried passing this string below into 'DefaultValue' props on ReactQuill.
cosnt textDocument =
<img id='ProfQuill' style='width: 100%; height: 400px;' src='${testPic}' width='777px'/><div class='headerBar'></div><h1>TITLE TEMP</h1><p></br>Paragraph and fake stuyff happening here oh yea boy....</p>
,
But the ReactQuill seems to parse out some information.
<h1><img src="/src/assets/image/CommHeader04.webp">TITLE TEMP</h1><p><br></p><p>Paragraph and fake stuyff happening here oh yea boy....</p>
I know this approach above is likely very, very far from ideal, but I don't know this editor well and have found nothing on feeding Quill more complex HTML default values for general templates. But it seems a lot is parsed out including divs even.
Any help is appreciated. Cheers !
I think there are limitations when it comes to dynamically inserting HTML tags into the Quill editor. With the release of the new react-quill-new version, it might be worth trying again, but for now, it still seems challenging.
I think there are limitations when it comes to dynamically inserting HTML tags into the Quill editor. With the release of the new react-quill-new version, it might be worth trying again, but for now, it still seems challenging.
Yeah, doesn't seem supported right now without massive workarounds.