Opened 8 years ago
Last modified 7 years ago
#45829 new defect (bug)
New editor replaces > with > within <pre> tag
| Reported by: | yannsalmon | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Editor | Version: | 5.0.2 |
| Severity: | major | Keywords: | dev-feedback needs-patch |
| Cc: | Focuses: | javascript |
Description
Hi,
I just updated to WordPress 5 and started using the new block editor.
I typeset source code in my posts using a <pre> tag. This code contains a > comparison operator. Upon saving my draft, > gets replaced with >, and this entity is also displayed in the article preview.
This happens even if I disable the visual editor.
The old editor does not present this bug and installing the Classic Editor extension allowed me to work around this.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
You are right!
Actually the behavior is quite strange. I have the following code:
<pre><div></div></pre>.
When I look into HTML it turns to
<p><pre><br><div><br></div><br></pre></p>
Not all
<are converted to<<br>,<p>and</p>all are fine.For hand written HTML tags like
preanddiv,>are not converted to>.It looks like default HTML tags rendered by Gutenberg are fine. The strange behavior starts with HTML tags we write by hand!