﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
45495	Extra P tags added to custom dynamic blocks	mattheu	pento	"As requested - opening a ticket on Trac for https://github.com/WordPress/gutenberg/issues/12646

I have a a custom block that is dynamic and rendered using the render callback.
The custom block renders the excerpt. 

The render callback returns something like this:
{{{#!php
<div>
    <a href=""http://example.com""><?php echo get_the_excerpt(); ?></a>
</div>
}}}

Prior to Gutenberg 4.6 this worked as expected. After updating, I now get paragraph tags added around the link.

Digging into this a bit - it seems the regression was caused by this change: https://github.com/WordPress/gutenberg/commit/2a66db0fc99a9fb1ba99f61e59e6a0b2a4a5f9ef#diff-6ff32417da0658502e7caa1a1abbeae6

The key difference is the new code restores the `wpautop` filter at a later priority, which is still getting run.

Digging into this some more - it is actually because `get_the_excerpt` internally calls `apply_filters( 'the_content' ` - which is a bit of a headache. 

There is a test case plugin on the github ticket to reproduce the bug."	defect (bug)	closed	normal	5.2	Editor		normal	fixed	has-patch has-unit-tests needs-testing		
