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

wpautop applied to FSE template parts #27857

Closed
hawkmusician opened this issue Dec 22, 2020 · 5 comments
Closed

wpautop applied to FSE template parts #27857

hawkmusician opened this issue Dec 22, 2020 · 5 comments
Labels
[Block] Template Part Affects the Template Parts Block [Type] Question Questions about the design or development of the editor.

Comments

@hawkmusician
Copy link

Describe the bug
wpautop seems to be applying on template parts in FSE (using dynamic blocks, image tags are wrapped with

and
is added automatically), which completely destroys the layout on the front end.

remove_filter( 'the_content', 'wpautop' ) not doing anything either.

@hawkmusician
Copy link
Author

To add to this, it's in the render_block_core_template_part function that $content = wpautop( $content ); is run which adds automatic paragraphs and breaks to blocks when not wanted.

Is this intended?

@annezazu annezazu added [Block] Template Part Affects the Template Parts Block [Feature] Full Site Editing [Type] Question Questions about the design or development of the editor. labels Dec 29, 2020
@pradeep910
Copy link

This wpautop is causing issue in AMP pages too. For example liveblog amp-live-list doesn't work. https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/template-part/index.php#L62

Screenshot 2021-01-23 at 5 55 06 PM

@Sandstromer
Copy link

wpautop in template parts is also breaking the alignment styling that was added in #29335

When using "Inherit default layout" on a block within the template part

<style>			.wp-container-608186cd787a8 > * {
				max-width: 610px;
				margin-left: auto;
				margin-right: auto;
			}</p>
<p>			.wp-container-608186cd787a8 > .alignwide {
				max-width: 1240px;
			}</p>
<p>			.wp-container-608186cd787a8 .alignfull {
				max-width: none;
			}
</style>

@Sandstromer
Copy link

Looks like fixed in #30552

@skorasaurus
Copy link
Member

Closing this since it's been fixed in #30552 ; please reopen if it's still applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

5 participants