Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 7, 2013

Description:

Shortcodes get injected with pre tags by tinymce when block-level html is included.

Steps to reproduce:

  1. Create a post
  2. In the text tab of tiny mce add a SH shortcode with an h1 (or any block-level tag) in it.
  3. Save the post
  4. After page reload, switch to the visual tab (to see the visual affect of injected pre tags)
  5. Switch back to the text tab ( to see injected code )

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 should not have code injected at the very least.

Actual Output:

Since SH passes unescaped html to the editor and wraps the shortcode in pre tags, tiny mce breaks up the shortcode in to segments injecting closing and opening pre tags to exclude the block level element from the pre content.

Tested with: WordPress 3.6-beta3-24430

Allow block-level elements as valid children of pre to stop tinymce
from segmenting shortcodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants