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

Convert to blocks: put unhandled HTML in HTML block, correct invalid lists #12118

Merged
merged 3 commits into from Nov 20, 2018

Conversation

Projects
None yet
3 participants
@iseulde
Member

iseulde commented Nov 20, 2018

Description

Fixes #12029.

After a quick look at the diffs and pasted content, it seems to me that the problem is (an) unhandled <dl> element(s).

Previously we would unwrap the element, then the block normaliser would merge the lines into a paragraph. Not ideal, but the content wasn't lost.

Now we preserve the tag, but there is no handler for dl.

Also restores correcting invalid list HTML.

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@iseulde iseulde added this to the 4.6 milestone Nov 20, 2018

@iseulde iseulde changed the title from Convert to blocks: put unhandled HTML in HTML block to Convert to blocks: put unhandled HTML in HTML block, correct invalid lists Nov 20, 2018

@iseulde

This comment has been minimized.

Member

iseulde commented Nov 20, 2018

@nosolosw How does this look?

@youknowriad

This comment has been minimized.

Contributor

youknowriad commented Nov 20, 2018

I know @jorgefilipecosta tried something similar recently for the pre handling? how is this related? and I know he faced some issues, so pinging for context.

@iseulde

This comment has been minimized.

Member

iseulde commented Nov 20, 2018

Moving to 4.5, feel free to punt if needed.

@iseulde iseulde modified the milestones: 4.6, 4.5 Nov 20, 2018

@youknowriad

Tests and code look good to me 👍

@iseulde

This comment has been minimized.

Member

iseulde commented Nov 20, 2018

Thanks @youknowriad!

@iseulde iseulde merged commit d387ac5 into master Nov 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@iseulde iseulde deleted the try/convert-unhandled-to-html branch Nov 20, 2018

@jorgefilipecosta

I did an extensive set of tests and everything looked in my tests, and the code looks correct 👍
I tried to understand the relation of this changes with the changes in #11244 and I think #11244 is still needed.
What happens now if we call wp.blocks.unregisterBlockType('core/preformatted'); and we paste <pre>aaaaa</pre> is that we get an HTML block with a pre tag but empty content because when the content arrives at the function that creates the HTML block it was already filtered in accordance with the schema of the code block and the invalid text child was removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment