-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding the bulk of the feature #1
Conversation
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.
a few little things. Overall 👍
protected function ul( DOMNode $node ): Block { | ||
return new Block( | ||
block_name: 'list', | ||
content: static::get_node_html( $node ), |
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.
WordPress 6.1 introduces a list item block
WordPress/gutenberg#42711
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.
attributes: [ | ||
'ordered' => true, | ||
], | ||
content: static::get_node_html( $node ), |
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.
same on the list item blocks WordPress/gutenberg#42711
*/ | ||
protected function minify_block( $block ) { | ||
if ( preg_match( '/(\s){2,}/s', $block ) === 1 ) { | ||
return preg_replace( '/(\s){2,}/s', '', $block ); |
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.
do we want to replace with ''
or ' '
?
'<!-- wp:html --> | ||
<div></div> | ||
<!-- /wp:html -->', | ||
'<!-- wp:paragraph --> | ||
<div> </div> | ||
<!-- /wp:paragraph -->', | ||
'<!-- wp:html --> | ||
<div> </div> | ||
<!-- /wp:html -->', | ||
'<!-- wp:paragraph --> | ||
<div> </div> | ||
<!-- /wp:paragraph -->', | ||
'<!-- wp:paragraph --><p><br></p><!-- /wp:paragraph -->', | ||
'<!-- wp:paragraph --><p><br><br><br></p><!-- /wp:paragraph -->', | ||
'<!-- wp:paragraph --> | ||
<p><br></p> | ||
<!-- /wp:paragraph -->', | ||
'<!-- wp:html --> | ||
<div> </div> | ||
<!-- /wp:html -->', | ||
'<!-- wp:heading {"level":3} --> | ||
<h3> | ||
</h3> | ||
<!-- /wp:heading -->', |
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.
I feel like there should be a better way to do this, but good enough for now...
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.
Yeah... I didn't write this part 🙉
Extracts the feature from Alleypack to be used in open-source packages.