Opened 6 weeks ago
Last modified 6 weeks ago
#64464 new defect (bug)
Does Not Escape the Ampersand when It Appears in Something that Looks Like Escape Codes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
When you type the following:
& 
The content for the RSS should be this:
& 
This will ensure that if someone types an escape code as is, then it will not change when parsed correctly as XML escape codes.
Some change (I think) made this work as expected for escape codes for hexadecimal escape codes. Decimal escape codes and name escape codes still do not render correctly. The post mechanism just stores these things as the escape code.
As a result, if I want to write
&
to show an example, I will fail. WordPress will only show the following:
&
Attachments (1)
Change History (3)
#1
@
6 weeks ago
- Version 6.8.3 deleted
I just tried publishing a post by adding this to a Paragraph block:
& 
In the code view in the editor, the content is:
<!-- wp:paragraph --> <p>&amp;<br>&#22;</p> <!-- /wp:paragraph -->
When looking at the RSS feed, the content appears as:
<content:encoded><![CDATA[ <p>&amp;<br>&#22;</p> ]]></content:encoded>
This seems to be what you are expecting?
#2
@
6 weeks ago
Yes, that is what I am expecting. I am using 6.8.3 of WordPress through a host. The customer service says this issue (which I first noticed in the RSS of the host-provided plugin) is upstream, with WordPress itself.
Apparently, since I had tested this, the hexadecimal escape codes work, as you can see in that screenshot. I found the issue and made some text to put in and test a while ago and simply forgot to file this with anybody.
If it worked for you, then it is probably because you had the paragraph block. My workflow has been fully in classic mode. The block mode, in my experience the past decade, is way too bloated and everything slows to a crawl, things crash, and I lose work. I never went anywhere near it again.
And so, it seems that the paragraph block (which is the default for many users today) fixes this issue, and the Classic mode bug never got noticed. That answers my question as to how this was not reported years ago. Most outlets would just furnish new thousand-dollar computers everywhere and just be “modern” with blocks and not care about computing resources.
I am as low resource as I can while still staying the GUI world. I run XFCE on Linux on old equipment. Waste not want not, etc.
Thank you for testing that. At least for my experience, the problem persists with WordPress 6.8.3 for named XML escape codes and for decimal XML escape codes.
(I cannot remember the original situation that brought this up, but I often find myself using some Markdown or whatever accidentally and having my board posts or web posts get messed up because I accidentally triggered some formatting change or I had sections between quotes or angle brackets just disappear entirely. In a way, I am obsessed with foolproofing WordPress. I just wish I knew how to program!)
Screenshot of the RSS