Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#33351 closed defect (bug) (invalid)

Pre code tags not always working in Text mode

Reported by: wordpresssites's profile wordpresssites Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.4
Component: Editor Keywords: needs-patch
Focuses: Cc:

Description

The pre and code tags don't work when wrapping the <?php opening tag.

Tested on 4.2.3, 4.2.4 and 4.3

Attachments (1)

text.png (16.2 KB) - added by wordpresssites 9 years ago.
Screenshot

Download all attachments as: .zip

Change History (5)

@wordpresssites
9 years ago

Screenshot

#1 @atomicjack
9 years ago

  • Keywords needs-patch added

Confirmed in WordPress 4.3-RC2-33608 (latest nightly build).

The output displays nothing within the <code> tags.

#2 follow-up: @obenland
9 years ago

  • Component changed from General to Editor
  • Summary changed from pre code tags not working in 4.3 to Pre code tags not always working in Text mode

Happens in Text only, switching to Visual escapes the < sign and it shows as expected.

Could reproduce as far back as 4.0.7.

#3 in reply to: ↑ 2 @wordpresssites
9 years ago

Replying to obenland:

Happens in Text only, switching to Visual escapes the < sign and it shows as expected.

Could reproduce as far back as 4.0.7.

Everyone who disabled the visual editor and is using these tags will have a problem.
Switching to Visual can also mess up all your PHP code.

Last edited 9 years ago by wordpresssites (previous) (diff)

#4 @azaozz
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The Text editor supports HTML. In HTML <, &, " and preferably > have to be entities. Otherwise it is invalid HTML :)

These rules apply for the content of the <pre> tag too. If you want better support for typing code samples, use one of the syntax highlighting plugins: https://wordpress.org/plugins/syntaxhighlighter/.

Note: See TracTickets for help on using tickets.