-
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
Raw handling: fix too aggressive indented list removal #62622
Conversation
const input = '<ul><li>\n<ul><li>test</li></ul>\n</li></ul>'; | ||
const output = '<ul><li>test</li></ul>'; | ||
expect( deepFilterHTML( input, [ listReducer ] ) ).toEqual( output ); | ||
} ); |
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.
The important tests are actually the integration tests, and curiously this doesn't make any integration tests fail, so it seems fine to leave content as it is.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -12 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Flaky tests detected in 589d266. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9547746000
|
Made a test, seem to work well. |
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.
The content loss was fixed.
I pasted the following code on the code editor:
<h3>Some heading</h3>
<ul>
<li style="list-style-type: none;">
<ul><!-- /wp:list-item --> <!-- wp:list-item --></ul>
</li>
<li>Content we need to preserve</li>
</ul>
I used the convert to blocks option and verified "Content we need to preserve" was preserved.
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: saulyz <sauliusv@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 057b484 |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: saulyz <sauliusv@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
What?
Follow-up to #62545, where @saulyz discovered that list item content is stripped when there's an empty list in an empty list item.
Why?
Content loss.
Currently indented lists are too aggressively outdented or removed entirely.
How?
Removal of unneeded logic.
Testing Instructions
Includes unit and integration tests.
Testing Instructions for Keyboard
Screenshots or screencast