[wp-trac] [WordPress Trac] #56120: WordPress should add a space character on every possible "wrap point" in a post title when building "html title", "og:title" and so on
WordPress Trac
noreply at wordpress.org
Fri Jul 1 05:13:27 UTC 2022
#56120: WordPress should add a space character on every possible "wrap point" in a
post title when building "html title", "og:title" and so on
-------------------------+-----------------------------
Reporter: pezcurrel | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
In WordPress it is possible to use html tags inside posts title. This is
very nice: for example, it allows to use italics, and to make posts titles
wrap where one wants. When the latter is the case, though, the titles get
displayed good in the post, but not in the browser's window title (that
usually the browser builds after the `<title>Foobar</title>` html entity),
and not in the link previews that one can get by linking a post into a
social network post (that usually have their title based on the `<meta
property="og:title" content="Foobar" />` entity).
For example, a post title like `First line<br>second line<br>third line`
will result in a `<title>First linesecond linethird line</title>` entity
and in a `<meta property="og:title" content="First linesecond linethird
line" />` entity, that will result in ugly and difficult to read browser
window and link previews titles.
This could be avoided by changing WordPress code so that it added a space
character on every possible "wrap point" (`<br>`, `</p>`, `</div>` and so
on) in a post title when building "html titles", "og:title"s and the
likes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56120>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list