#35933 closed defect (bug) (invalid)
[embed] always renders in visual editor, even if wrapped in either <code> or <pre>
Reported by: |
|
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>[embed[[/embed[</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)
Closed. I was informed that shortcodes should be escaped with double brackets
example: