syntaxhighlighter icon indicating copy to clipboard operation
syntaxhighlighter copied to clipboard

BugFix for unescaped html in shortcodes gets parsed/styled in visual editor

Open ghost opened this issue 11 years ago • 1 comments

Description:

SH passes unescaped html to the tiny mce editor. The tags are getting parsed and styled by the user-agent in some instances. The reset specifies that children of pre should inherit some style from pre.

Steps to reproduce:

  1. Create a post
  2. In the text tab of tiny mce add a SH shortcode with an h1 in it.
  3. Save the post
  4. After page reload, switch to the visual tab

Example short code [html]<h1>This is an h1</h1>[html]

Expected output:

The user should be able to switch tiny mce modes (text/visual) and the content of the shortcode will consistently be styled with pre in visual mode

Actual Output:

Since SH passes unescaped html to the editor, the html gets parsed by the browser applying user-agent styles and theme editor styles to the h1 tag

Tested with: WordPress 3.6-beta3-24430

ghost avatar Jun 07 '13 22:06 ghost

I think I have the same/similar problem as this. I'm using Markdown on Save Improved & Typewriter - Markdown for WordPress I'm not sure where the problem is, or whether it's just a plugin compatibility problem. What is the recommended editor? and general set of plugins?

An example of my broken page can be found here: http://matlabrecipes.com/matlab-linear-indices/

You'll see my first snippet of code has spurious <p> tags.

enewton avatar Jan 17 '14 13:01 enewton