-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pullquote: Fix parsing/serializing multi-paragraphs in pullquotes #1987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youknowriad tested a bit and seems this approach perfectly works in Gutenberg.
However, when editing a post with a pullquote in the Classic editor, and then again in Gutenberg, the content gets lost. Not sure if this should go in a separate issue.
For example: inserted a pullquote with 2 paragraphs:
<blockquote class="wp-block-pullquote alignnone">
<p>My quote</p>
<p>with multiple par</p>
<footer>my caption</footer>
</blockquote>
Saved, then opened the same post using the Classic editor, switched to text mode and the markup was changed to:
<!-- wp:core/pullquote -->
<blockquote class="wp-block-pullquote alignnone">My quote
with multiple par
<footer>my caption</footer></blockquote>
<!-- /wp:core/pullquote -->
This perfectly works in the Classic editor, but when editing again in Gutenberg, it doesn't of course and the content gets stripped out.
Marking as "Request changes" just because I'm not sure if you want to open a new issue.
See above comment, this is a larger issue and should be handled separately.
0c3e5ac fixes the previously existing tests. 2f96b6c adds a new test for this condition. Strangely, before this PR, this test would have already passed - whatever issue caused the duplicate Adding that new test surfaced a warning which I'm able to reproduce by using the editor:
|
I fixed the warning, I'm not totally satisfied with the fix but it has to do with the |
There is an untested branch in the latest commit. How about fixing that by adding a I would like to know why this bug was occurring in the UI but not the test suite. Any thoughts there? |
I thought about this and here is my hypothesis:
But when we use TinyMCE (the editable), for each item of the array, it adds a |
Added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
<blockquote class="wp-block-pullquote alignnone"> | ||
<p>Paragraph <strong>one</strong></p> | ||
<p>Paragraph two</p> | ||
<footer>by whoever</footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whomever 🤓
8cec198
to
d64562e
Compare
d64562e
to
11dc880
Compare
closes #1982
This PR seeks to solve the parsing/serializing issues we were experiencing when typing multiple paragraphs in pullquotes.
Testing instructions