How can you detect and delete leading/trailing whitespace in Quill, which is a rich text editor?
For instance, the sample HTML below represents Quill output for the text "\nHi".
We want to detect and delete leading and trailing whitespace for each block of the text created by Quill (not for an entire document). Basically, trim leading/trailing whitespace for each embedded Quill editor. (We embed multiple editors within the same page.)
The API doesn't seem to offer a simple way to achieve this and would require some hacking?
Is there an elegant way to trim text with Quill effectively?
<div class="ql-editor"
data-gramm="false"
contenteditable="true"
spellcheck="false"
autocomplete="off"
autocorrect="off"
autocapitalize="off">
<p style="align-self: center;">
<br>
</p>
<p style="align-self: center;">
<span style="font-family: Lato; color: rgb(0, 0, 0); font-size: 80px; line-height: 1.5; letter-spacing: 0em; font-weight: 400; font-style: normal;">Hi </span>
</p>
</div>