Skip to content

Newlines in SEO description get replaced with zero whitespace #2354

Closed
@efung

Description

@efung

For a post in which I have not defined my own description, I rely on the page.excerpt to populate the seo_description variable in the seo.html include file.

However, I have noticed that if my first paragraph has newlines, the generated description does not have whitespace where the newline used to be. Sample first paragraph of post body:

I made a superb
dessert (in my humble opinion, but also everyone who tasted it). It was high
effort, but also high reward. Read on to see how I made it.

Generated description (from HTML head):

<meta name="description" content="I made a superbdessert (in my humble opinion, but also everyone who tasted it). It was higheffort, but also high reward. Read on to see how I made it.">

Note that there is no space between "superb" and "dessert", nor between "high" and "effort".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions