const initialHTML = `Als work-Kund:in bekommst Du 10 € GigaKombi-Rabatt und Extra-Datenvolumen.
<br>
Auf Wunsch bekommst Du ein aktuelles Top-Smartphone ab 1 € dazu.
<br>
<b>Deine Vorteile im Überblick:</b>
<ul>
<li>Weil Du schon Internet von uns hast – 10 € Preisvorteil pro Monat und Extra-Datenvolumen</li>
<li>Mobile & Euro-Flat in deutsche Mobilfunk- und die Festnetze von mindestens 25 Ländern</li>
<li>Bis zu 6 Monate keine doppelten Mobilfunk-Kosten</li>
<li>Einfache Rufnummer-Mitnahme</li>
</ul>`
I have this initialHTML. I am giving this to richtext editor but all of the richtext editor is adding first line (Als work-Kund:in bekommst Du 10 € GigaKombi-Rabatt und Extra-Datenvolumen.
) into (eg. <p>Als work-Kund:in bekommst Du 10 € GigaKombi-Rabatt und Extra-Datenvolumen.</p>
).
I want to avoid this senario. how to prevent this?
I used liraries like React-quill, @tinymce/tinymce-react, slate-react, etc.
React-quill
<ReactQuill theme="snow" value={description} onChange={(e) => {
console.log('e=>', { e })
setDescription(e)
}} />
@tinymce/tinymce-react
<Editor
apiKey={editorKey}
onEditorChange={(e) => setDescription(e)}
value={description}
disabled={false}
init={{
menubar: true,
plugins: [
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
'insertdatetime', 'media', 'table', 'help', 'wordcount', 'nonbreaking'
],
toolbar: 'undo redo | bold italic underline backcolor | alignleft aligncenter alignright alignjustify bullist | removeformat nonbreaking',
}}
/>