Skip to content
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

Block filtering broke WP Cover block markup #232

Open
qzya opened this issue Jun 24, 2024 · 0 comments · May be fixed by #233
Open

Block filtering broke WP Cover block markup #232

qzya opened this issue Jun 24, 2024 · 0 comments · May be fixed by #233

Comments

@qzya
Copy link

qzya commented Jun 24, 2024

Block processing in

private function processCoverBlock($id, $block_content) {
totally breaks markup of WordPress Cover Block: str_replace() adds the mcloud-attachment-{$id} class for class lists that contain such classes like wp-block-cover-is-layout-constrained or wp-block-cover__image-background and not only for class lists that contain the wp-cover-block class.

For example, this markup:

<div class="wp-block-cover">
    <span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span>
    <img
        class="wp-block-cover__image-background wp-image-220145"
     >
    <div class="wp-block-cover__inner-container is-layout-constrained wp-block-cover-is-layout-constrained">
        <p class="has-text-align-center has-large-font-size">Cover title</p>
    </div>
</div>

turns to

<div class="wp-block-cover mcloud-attachment-220145">
    <span aria-hidden="true" class="wp-block-cover mcloud-attachment-220145__background has-background-dim"></span>
    <img 
        class="wp-block-cover mcloud-attachment-220145__image-background wp-image-220145"
    >
    <div class="wp-block-cover mcloud-attachment-220145__inner-container is-layout-constrained wp-block-cover mcloud-attachment-220145-is-layout-constrained">
        <p class="has-text-align-center has-large-font-size">Cover title</p>
    </div>
</div>
@qzya qzya linked a pull request Jun 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant