Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#45144 closed defect (bug) (worksforme)

Empty p-tags before image with caption in classic text editor

Reported by: codegrau's profile codegrau Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.8
Component: Editor Keywords: close reporter-feedback
Focuses: Cc:

Description

Adding an image with caption in "classic" text editor (my preferred editor) will result in empty p-tags before figure tags and non-surrounded text after <figure>.

Press the Media Button in WordPress classic text editor to insert an image with caption. Following output is generated:

[caption id="attachment_1" align="alignleft" width="150"]<img src="url-to-image.jpg" alt="alt" width="150" height="150" class="size-thumbnail wp-image-1" /> captiontext[/caption] This is text for my Test post with Image.

When using the classic text editor, the output begins with an empty paragraph tag like:

<p></p> <!-- empty p-tag before figure-tag -->
<figure>
<img src="...">
<figcaption>...</figcaption>
</figure>
" This is text for my Test post with Image." <!-- no tags at all -->

when saving afterwards in "visual editor" (or editing and saving the whole post) the output is correct:

<figure>
<img src="...">
<figcaption>...</figcaption>
</figure>
<p>This is text for my Test post with Image.</p>

Please have a look at this.

Change History (3)

This ticket was mentioned in Slack in #core by talldanwp. View the logs.


5 years ago

#2 @talldanwp
5 years ago

  • Keywords close reporter-feedback added

Hi @codegrau, thanks for reporting this, and apologies for the delayed response!

This ticket was mentioned in a triage session in slack (requires a slack account to access - https://wordpress.slack.com/archives/core/p1576734592046500)

A few of us tested this using the Classic Editor plugin with a more recent version of WordPress, and weren't able to reproduce the problem you mentioned. Is this something you're still experiencing?

#3 @noisysocks
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.