Opened 6 months ago
Closed 5 months ago
#61376 closed defect (bug) (reported-upstream)
Site editor template description displays encoded characters
Reported by: | poena | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
In the Site Editor, it is possible to create a custom page template for pages that have a combination of text and HTML entities in the title.
When such a page template is displayed in the Site Editor, it displays the page title as part of the template description in the Template panel in the Site Editor Sidebar.
The HTML entities are not decoded, for example, a template for a page called
"Hello World & Hello WP" Would show the description: "Template for Hello World & Hello WP"
For some reason, If the page is only called "&" the description displays as "Template for &".
I have only tested this on 6.6-beta1-58337-src. Further testing is needed to determine where the problem was introduced.
The reason why I created a trac ticket instead of a Gutenberg GitHub issue is because the problem seems to be in
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/block-template-utils.php#L675
Testing Instructions
These steps define how to reproduce the issue, and indicate the expected behavior.
Steps to Reproduce
- Activate a block theme.
- Create a new page with the title "Hello World & Hello WP"
- Go to Appearance > Editor > Templates.
- Select "Add new template". Select Pages, and then select the page you just created.
- Open the settings sidebar and the template panel.
- The description is in the template panel below the page name, close to the top. Check if & displays correctly
Expected Results
- ❌ the character displays as &
Attachments (1)
Change History (3)
#1
@
6 months ago
@poena it seems gutenberg editor issue. So, I have created the same as you mentioned in this ticket in gutenberg - https://github.com/WordPress/gutenberg/issues/62335
Also added the PR for it - https://github.com/WordPress/gutenberg/pull/62336
The template description