Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#17330 closed defect (bug) (worksforme)

TinyMCE breaks HTML anchors with the "name" attribute

Reported by: ranyanivhartstein's profile RanYanivHartstein Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: TinyMCE Keywords:
Focuses: Cc:

Description

When you create an HTML anchor with the name attribute in the HTML editor, and then switch to the visual editor, it removes the contents of the tag and places it outside of it, leaving the tag empty.

To reproduce, enter this in the HTML editor:

<a name="bob">Inside</a>

Switch to the visual editor (notice the word "inside" isn't styled as an anchor), and then switch back to the HTML editor. This is what it will look like:

<a name="bob"></a>Inside

This only seems to happen with the name attribute - couldn't reproduce with other attributes such as id.

Initially reported by a WordPress.com user. Tested on latest WordPress.org trunk.

Change History (1)

#1 @azaozz
14 years ago

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

From HTML point of view <a name="bob">Inside</a> is exactly the same as <a name="bob"></a>Inside. The anchor is a hidden pointer to where the page should scroll when accessed with http://someurl#anchor.

Last edited 14 years ago by azaozz (previous) (diff)
Note: See TracTickets for help on using tickets.