-
Notifications
You must be signed in to change notification settings - Fork 272
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
[Data Liberation] Refactor Entity Readers class diagram #2096
Conversation
Adds a basic WP_HTML_To_Blocks class that accepts HTML and outputs block markup. It only considers the markup and won't consider any visual changes introduced via CSS or JavaScript. A part of #1894 ## Example ```html $html = <<<HTML <meta name="post_title" content="My first post"> <p>Hello <b>world</b>!</p> HTML; $converter = new WP_HTML_To_Blocks( $html ); $converter->convert(); var_dump( $converter->get_all_metadata() ); /* * array( 'post_title' => array( 'My first post' ) ) */ var_dump( $converter->get_block_markup() ); /* * <!-- wp:paragraph --> * <p>Hello <b>world</b>!</p> * <!-- /wp:paragraph --> */ ``` ## Testing instructions This PR mostly adds new code. Just confirm the unit tests pass in CI.
abad470
to
0faab1a
Compare
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.
This is an excellent refactoring. I like the new consistency in naming classes and interfaces around the "entity" word. Can we resolve the conflicts here? Once solved, I am okay with merging this. 👍
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.
All good!
Sets the stage for the EPub importer. A part of #2080
Refactors and clean up the Data Liberation package. This includes renaming, reorganizing file paths, improving class structure, and removing deprecated/unused code.
Key Changes
Refactor:
WP_WXR_Reader
toWP_WXR_Entity_Reader
for consistency and clarity.byte-readers
to the Blueprints library (see Streaming readers: Bytes, Filesystem, Zip blueprints-library#121)Cleanup:
WP_Byte_Reader
,WP_File_Reader
, etc.).WXR_Import_Info
.New Additions:
WP_Directory_Tree_Entity_Reader
to improve handling of directory tree imports.WP_Import_HTML_Processor
for better HTML import functionality.Testing instructions
Confirm the CI tests passed