Make WordPress Core

Opened 10 years ago

Closed 7 years ago

#39782 closed defect (bug) (wontfix)

TinyMCE strips empty a href tags breaking code...

Reported by: jkirker Owned by:
Priority: normal Milestone:
Component: TinyMCE Version: 4.7.2
Severity: normal Keywords:
Cc: Focuses:

Description

TinyMCE is stripping empty a href tags breaking our site.

IE:

<a href="​http://domain/page/xyz.pdf" class="pdflink"></a> - PDF Document Description

These are also eventually systematically replaced after several reloads.

<a href="​http://domain/page/xyz.pdf" class="pdflink">&nbsp;</a> - PDF Document Description
<a href="​http://domain/page/xyz.pdf" class="pdflink"><icon></icon></a> - PDF Document Description

etc.

Change History (1)

#1 @azaozz
7 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

Yes, empty inline elements are considered "user errors" and are stripped by default, not just in TinyMCE but most (all?) editors I've seen. They are invisible and "unclickable" on the front-end.

Not sure how you're inserting these <a> tags, but perhaps try padding them with a HTML comment, or an entity. Then they will be considered non-empty (although will still be invisible on the front-end).

This is now superseded by the block editor. Closing as wontfix, feel free to reopen (perhaps with a patch) if this still needs fixing in the classic editor.

Note: See TracTickets for help on using tickets.