Repository navigation
[Data Liberation] Refactor Entity Readers class diagram - #2096
Merged
Merged
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.
adamziel
marked this pull request as draft
December 17, 2024 13:53
adamziel
force-pushed
the
refactor-readers
branch
from
December 17, 2024 13:56
abad470 to
0faab1a
Compare
adamziel
marked this pull request as ready for review
December 17, 2024 13:56
This was referenced Dec 17, 2024
zaerl
suggested changes
Jan 8, 2025
zaerl
left a comment
Contributor
There was a problem hiding this comment.
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. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_ReadertoWP_WXR_Entity_Readerfor consistency and clarity.byte-readersto the Blueprints library (see Streaming readers: Bytes, Filesystem, Zip php-toolkit#121)Cleanup:
WP_Byte_Reader,WP_File_Reader, etc.).WXR_Import_Info.New Additions:
WP_Directory_Tree_Entity_Readerto improve handling of directory tree imports.WP_Import_HTML_Processorfor better HTML import functionality.Testing instructions
Confirm the CI tests passed