WordPress.org

Make WordPress Core

Opened 22 months ago

Last modified 9 months ago

#48402 new defect (bug)

Preformatted blocks do not remove styled line spacing

Reported by: trickywidget Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: 2nd-opinion
Focuses: Cc:

Description

The line spacing in a Preformatted block is not correct. It is still being styled, which results in line spacing that is too high. This is clearly seen when using Unicode box-drawing characters. See attached image for an example.

Attachments (1)

Preformatted.png (10.4 KB) - added by trickywidget 22 months ago.

Download all attachments as: .zip

Change History (4)

#1 @noisysocks
9 months ago

  • Keywords reporter-feedback added

Hi @trickywidget. Line height in this case would be up to the theme. Does changing the line height in the theme / the theme's editor.css change the line height in the Preformatted block?

#2 @trickywidget
9 months ago

Anything in <pre></pre> tags should not be affected by the theme in any way. The whole point of them is that it designates content that is excluded from external formatting. Hence the bug report. If the theme line height is being applied by design, then it is not preformatted and the block needs to be renamed.

https://www.w3.org/TR/2011/WD-html5-author-20110809/the-pre-element.html

#3 @noisysocks
9 months ago

  • Component changed from Editor to Bundled Theme
  • Keywords 2nd-opinion added; reporter-feedback removed

<pre> doesn't denote text that is excluded from external formatting, just text that has a "structure represented by typographic content rather than by elements".

In other words, structure such as newlines and whitespace are determined using literal characters such as \n and rather than by elements such as <br>. CSS can still be used to style properties such as line-height, font-weight, letter-spacing, etc.

I do agree, however, that when using the default Twenty Twenty theme, the line height in a Preformatted block is so large that it renders the block impractical for things such as ASCII art and diagrams. This line-height is set by Twenty Twenty's pre styling.

I'd like us to consider decreasing the default pre line height, so am moving this ticket to Bundled Theme.

Note: See TracTickets for help on using tickets.