Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 5 days ago

#3624 closed defect (bug) (invalid)

Fixing broken tags in <pre> blocks

Reported by: robertaccettura's profile robertaccettura 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.

Change History (4)

#1 follow-up: @Viper007Bond
17 years ago

You need to do < -> &lt; and > -> &gt;. 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.

#2 in reply to: ↑ 1 @Viper007Bond
17 years ago

Er, a bit clearer:

You need to do < to &lt; and > to &gt;.

#3 @Znuff
17 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Using <> in <blockquote> tags makes the browser try to parse those tags as valid. W3 Validator will freak out. I'd say this should be closed.

#4 @Nazgul
17 years ago

  • Milestone 2.2 deleted
Note: See TracTickets for help on using tickets.