quill
quill copied to clipboard
Pasting HTML with Strong and List Separated by Newline Places the Strong Content within the List
Steps for Reproduction
- Copy HTML from a page that includes this:
<strong>one</strong>
<ol>
<li>two</li>
<li>three</li>
</ol>
- Paste it into the Quill Playground.
Expected behavior:
The editor should show:
one
- two
- three
Actual behavior:
The editor displays this instead:
- onetwo
- three
This happens if there is a newline between the <strong>
element and the <ol>
. For example, it works if the newline isn't there:
// Good
quill.clipboard.dangerouslyPasteHTML('<strong>one</strong><ol><li>two</li><li>three</li></ol>')
<p><strong>one</strong></p><ol><li>two</li><li>three</li></ol>
But the position of the <strong>
shifts into the <ol>
when there's a newline:
// Bad
quill.clipboard.dangerouslyPasteHTML('<strong>one</strong>\n<ol><li>two</li><li>three</li></ol>')
<ol><li><strong>one</strong>two</li><li>three</li></ol>
Pasting the example works fine in other WYSIWYG editors like Trix.
Platforms: Chrome, macOS Version: 1.3.7
Hey @luin is it a valid bug? if yes can I try fixing this?
@Shubhdeep12 Yeah looks like a bug.
Ok thanks for the confirmation @luin , i'll push a fix for this.
Hi @luin added a PR with fix. Thanks cc @benbro