Automattic / Automattic/jetpack

Classic Editor adds extra p tags to Instagram Embed

Open
#17,329 9 comments 1 reaction 0 assignees View on GitHub
[Feature] Shortcodes / Embeds [Pri] Low Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Use Classic Editor.
2. Place Instagram post url to editor (doesn't matter Visual, Text, with or without p tags)
3. Save Post.
4. Check frontend code.

#### What I expected
No extra p tags, eg what you get with `remove_filter( 'the_content', 'wpautop' );`.

#### What happened instead

Closing `

` tag after the first link:

```



```
Closing `
` is inside p tag: `

`

#### Other information

This is essentially the same issue as https://core.trac.wordpress.org/ticket/51328 - it only happens with Classic Editor, with and without Jetpack. Core probably won't fix as they are removing the Instagram embed?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in Classic Editor with an Instagram post URL, then compare the saved frontend markup with and without the wpautop filter. Done means the Instagram embed no longer receives extra p tags or malformed paragraph and anchor markup.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.