-
Notifications
You must be signed in to change notification settings - Fork 799
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
Carousel: Improve DOM Parsing #13547
Conversation
* Separate `->add_data_to_container()` into `->add_data_to_container()` for the `gallery_style` filter (which filters only an opening `<div>` tag), and `->add_data_to_html()` for general HTML. * Wrap input to `DOMDocument->loadHTML()` in fake root tag. * Specify blog's charset in input to `DOMDocument->loadHTML()`. * Add tests for different charsets.
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: October 1, 2019. |
mdawaffe, Your synced wpcom patch D33204-code has been updated. |
This was the best I could come up with for improving HTML parsing via DOMDocument. I don't think it's good enough :( As you can see from the failing (new) tests:
The current code (#13446) also fails these tests. (The tests need to be tweaked to run with the code in #13446: there is no Should we switch back to |
Closing in favour of #13554 |
Fixes #13531, but not really.
Changes proposed in this Pull Request:
->add_data_to_container()
into->add_data_to_container()
for thegallery_style
filter (which filters only an opening<div>
tag), and->add_data_to_html()
for general HTML.DOMDocument->loadHTML()
in fake root tag.DOMDocument->loadHTML()
.Is this a new feature or does it add/remove features to an existing part of Jetpack?
No: bug fix.
Testing instructions:
phpunit --testsuite=carousel
Proposed changelog entry for your changes:
Carousel: Improve HTML parsing.