Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35933 closed defect (bug) (invalid)

[embed] always renders in visual editor, even if wrapped in either <code> or <pre>

Reported by: mike_vl's profile mike_vl Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Editor Keywords:
Focuses: Cc:

Description

Context: I am working on the https://make.wordpress.org/docs/handbook/about-the-docs-team/current-docs-projects/helphub/ WordPress documentation project.

In the post editor, in text mode, if you wrap [embed] in <pre>, <code> or convert the brackets to html entities, the <pre>and <code> tags are removed and the editor will render the embed. I've searched if there is a bugreport, but havent't found one.

Use case:
Insert the code below:

<pre>[embed][/embed]</pre>

in text mode, switch to visual editor and back.
Either just the opening pre, code tags are removed of both the opening and closing pre, code tags are removed. If you then switch to visual editor the embed is rendered.

Use case
First convert the brackets to html entities and then wrap it in <pre> or <code>, like so:

<pre>&lbrack;embed&lbrack;&lbrack;/embed&lbrack;</pre>


switching from text editor to visual editor and back. The html entities will be converted to regular brackets and once again the embed will be rendered in the visual editor.

I have tested on multiple installs (different versions of WordPress and different domains/serverconfigurations)

Change History (2)

#1 @mike_vl
9 years ago

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

Closed. I was informed that shortcodes should be escaped with double brackets

example:

[[embed]]

#2 @netweb
9 years ago

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