Skip to content

Reader is removing too much whitespace #11088

Closed

Description

@koke

A user reports that some of their Gutenberg posts are missing spaces on the reader. After some debugging, I noticed the HTML source had something like this:

<p>1
Corinthians 13:12- For now we see only a reflection as in a mirror; then we
shall see face to face.&nbsp; Now I know in
part; then I shall know fully, even as I am fully known.&nbsp; </p>

There's a \n at the end of each line, that normal web rendering would present as a single space, but the native reader seems to be stripping

Activity

  1. koke commented on Feb 19, 2019

    @koke
    MemberAuthor

    We seem to be simply removing any new line outside a <pre> tag from post content.

    I tried replacing \n+ with a space, but it's a bit more complicated than that.

    According to the specs (HTML, CSS), the rules for normal whitespace rendering (outside <pre>) should be:

    • Any tab or newline gets converted to a space
    • Any sequence of spaces gets converted into a single space
    • Any space at the start or end of a tag gets removed
  2. designsimply commented on Feb 20, 2019

    @designsimply
    Contributor

    Possibly related: WordPress/gutenberg#12166

  3. stale commented on Mar 11, 2020

    @stale

    This issue has been marked as stale because:

    • It has been inactive for the past year.
    • It isn't in a project or a milestone.
    • It hasn’t been labeled [Pri] Blocker, [Pri] High, or good first issue.

    Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority (cc @designsimply).

  4. leandroalonso commented on Mar 24, 2021

    @leandroalonso
    Contributor

    Reader Detail now uses a webview, which shouldn't cause this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions