#3624 closed defect (bug) (invalid)
Fixing broken tags in <pre> blocks
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.0.7 |
Component: | Administration | Keywords: | html |
Focuses: | Cc: |
Description
<pre lang="html4strict">
<meta content="foo" name="bar">
<meta content="baz" name="zap">
</pre>
Wordpress turns it into:
<pre lang="html4strict">
<meta content="foo" name="bar">
</meta><meta content="baz" name="zap">
</meta></pre>
At a minimum there should be the ability to override such behavior via either a <!-- NOPARSE --> <!-- /NOPARSE --> tags or something.
The above isn't correct because there are many cases where one may want to display only some code, and not close everything up. WordPress should attempt to keep things valid, but not at the expense of altering data beyond intent.
The caveat here is that plugins may modify things here (such as syntax highlighting, and escaping <>&. But that's when viewed not saved.
I think the best solution is to have a way to exempt the assistance wordpress provides for certain blocks via a html comment.
You need to do
<
-><
and>
->>
. WordPress treats everything you enter as HTML. There's no code display functionality in the core.You'll need to use a code display plugin.