Skip to content

Support removing </p>...<p> from content inside shortcodes#47

Merged
mpdude merged 4 commits into
masterfrom
remove-inner-p
May 27, 2026
Merged

Support removing </p>...<p> from content inside shortcodes#47
mpdude merged 4 commits into
masterfrom
remove-inner-p

Conversation

@mpdude
Copy link
Copy Markdown
Member

@mpdude mpdude commented May 27, 2026

When embedding shortcodes in HTML markup (for example, writing shortcodes in an editor like CKEditor or TinyMCE) and using opening/closing shortcodes with content in between, dangling </p>...<p> tags may remain inside the shortcode.

This PR adds a new RemovePendingParagraphElementsInsideShortcodeEventHandler to remove these tags.

To avoid breaking BC, this feature has to be enabled by setting the remove_pending_inner_paragraph_elements config setting.

Additionally, to make it easier to register multiple event listeners in the \Thunder\Shortcode\EventContainer\EventContainer, a new webfactory.shortcode.event_listener tag is added to the container. It must be used with a event attribute value to indicate the event to subscribe to.

@mpdude mpdude changed the title remove inner p Support removing </p>...<p> from content inside shortcodes May 27, 2026
@mpdude mpdude merged commit 5fbe30a into master May 27, 2026
@mpdude mpdude deleted the remove-inner-p branch May 27, 2026 21:09
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 this pull request may close these issues.

1 participant