Skip to content

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

@ghost

Description

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. This is because block-level elements are not valid children of the pre element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions