WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#30447 closed defect (bug) (fixed)

Line spacing in PREformatted text - found solution!

Reported by: Kzrider Owned by:
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.0
Component: Embeds Keywords:
Focuses: Cc:

Description

I've found problem, that was described but unsolved: http://en.forums.wordpress.com/topic/irregular-line-spacing-in-preformatted-text

Basicly when I use <pre> tag and put urls inside it, wordpress adds extra line spacing between them while displaying page:

<pre>http://some.link/
http://some.other.link/</pre>

is converted to:

<pre>http://some.link/

http://some.other.link/</pre>

The source of this is autoebeding feature. To be exact - in file class-wp-embed.php in function autoembed_callback( $match ) there is a line:

return "\n$return\n";

This is the source of problems.

I'managed to turn off autoembeding in my wordpress site but I'm not familiar with wordpress to fix it. Hopefully, someone could repair it with knowledge about source of the problem. Preferably by turning off autoemneding inside <pre> and <code> tags.

Change History (3)

#1 @dd32
5 years ago

  • Component changed from Formatting to Embeds

Pretty sure we shouldn't try embedding URL's when in <pre> or <code> tags, Partially related is #23776 but that doesn't cover this case exactly.

#2 @SergeyBiryukov
5 years ago

  • Keywords pre autoembed removed

Seems like the latest patch on #23776 should resolve this.

#3 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 4.2
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [31066].

Note: See TracTickets for help on using tickets.