Opened 9 years ago
Last modified 6 years ago
#32867 new defect (bug)
Wordpress replaces HTML entities for angle brackets in titles, breaking HTML validation
Reported by: | CRCulver | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.2.2 |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
In the scientific field I blog about, the opening and closing angle brackets are technical symbols. Because in valid HTML these symbols must always be escaped, I typically write them in the Wordpress post editor with their HTML entities: <
and >
.
In the body of a post, Wordpress preserves those HTML entities as HTML entities, so the result is conformant HTML. However, when I enter those HTML entities into the Title field for a post, and then click Save, Wordpress replaces the HTML entity with the actual character. Consequently, the page is not valid HTML, and the W3C validator for instance will throw up an error due to an unescaped angle bracket.
Note that this does not happen with the other HTML entities for these particular symbols: <
and >
. If those are entered into the Title field of a post, they survive after the user clicks Save. So, <
and >
should get the same treatment.
See also #31790