Paste As Quotation creates `blockquote` inside `p` (and nested `p`) - invalid HTML
Categories
(Core :: DOM: Editor, defect, P5)
Tracking
()
People
(Reporter: jake, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
Version 60.9.1 (32-bit), Windows 7 x64 - Thunderbird is up to date
- Insert the following HTML into a new message:
<p>Hi John,</p>
<p><br>
</p>
<p>I think...</p>
-
Copy some formatted text (e.g. from another email message) to the clipboard, ideally involving more than one paragraph.
-
Position the caret in the empty paragraph between "Hi John," and "I think...".
-
Right-click and select Paste As Quotation.
Actual results:
This is the resulting HTML:
<p>Hi John,</p>
<p>
<blockquote type="cite">First paragraph.
<p>Second paragraph.</p>
</blockquote>
<br>
</p>
<p>I think...</p>
This is invalid HTML. Paragraph elements may only contain phrasing content. The block quotation element is flow content and not allowed inside a paragraph element. Moreover, paragraph elements may not contain other paragraph elements.
Expected results:
The blockquote element should be created outside of any p element, with new p elements created within the pasted blockquote as necessary. In this case, the blockquote should probably be inserted before the p element that the caret was positioned in. If there caret were in the middle of a paragraph, the paragraph should be split (by adding closing and re-opening p tags) with the blockquote inserted at the split (between the closing and re-opening p tags).
In the example given, the resulting HTML should, I think, be as follows:
<p>Hi John,</p>
<blockquote type="cite">
<p>First paragraph.</p>
<p>Second paragraph.</p>
</blockquote>
<p><br>
</p>
<p>I think...</p>
...with the caret positioned in the empty paragraph after the blockquote.
Comment 1•6 years ago
|
||
Confirmed. The operation described in comment #0 creates invalid HTML, a blockquote inside a p.
Updated•6 years ago
|
Updated•5 years ago
|
Description
•