• Resolved hommealone

    (@hommealone)


    I was hoping this plugin would allow me to use shortcodes in my HTML editor without WP wrapping them in p tags. (I thought I’d try wrapping my shortcode in raw shortcode tags.)

    With the Raw HTML plugin, WP is now adding a </p> tag after the closing [/raw] tag (or the <!--/raw--> tag).

    In an earlier thread, you wrote:

    It’s WordPress that generates those <p> tags. In most cases, you can avoid them by placing your content on the same line as the <!–end_raw–> tag, not on a new line.

    This does not work. The first time that I save the page, WP adds a new line after the closing [/raw] tag; when I save a second time, the extra </p> tag comes back.

    What can I do?

    https://wordpress.org/plugins/raw-html/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    Could you please post some sample code that illustrates the problem? I can’t seem to reproduce the issue – when I save a page, WP does not add a new line after the [/raw] tag.

    Edit: Also, Raw HTML currently does not support running shortcodes inside [raw]…[/raw] tags. This is because it’s designed to prevent WP from changing the tag content in any way, which also usually prevents WP from replacing a shortcode with new HTML code.

    Thread Starter hommealone

    (@hommealone)

    Here’s what I mean; ever seen this before?

    If I input this into the html editor:

    <div>
    [raw]
    <p>Some text.</p>
    [/raw]<p><img class="alignnone size-full wp-image-258" ...

    the first time I save it, it becomes this:

    <div>
    [raw]
    <p>Some text.</p>
    [/raw]
    <p><img class="alignnone size-full wp-image-258" ...

    and when I save it again it becomes:

    <div>
    [raw]
    <p>Some text.</p>
    [/raw]</p>
    <p><img class="alignnone size-full wp-image-258" ...

    I should also say that I use the TinyMCE Advanced plugin and take advantage of its “Stop removing the <p> and <br /> tags when saving and show them in the Text editor” feature.

    I have tried this with and without disabling wpautop.

    This doesn’t only happen with your plugin; it happens whenever I try to insert a shortcode that uses opening and closing tags.

    I know this is not the fault of your plugin; I’m just wondering if you have any guesses about what might be causing it?

    Thanks for any advice you might provide!

    Plugin Author Janis Elsts

    (@whiteshadow)

    I should also say that I use the TinyMCE Advanced plugin and take advantage of its “Stop removing the <p> and
    tags when saving and show them in the Text editor” feature.

    That’s probably it. This plugin has only been tested with the default post editor. Currently it does not support any other editors.

    Each editor has its own quirks. I wasn’t able to reproduce the issue using the built-in editor (even with your sample code), but it’s unsurprising that another editor might have different edge cases.

    Thread Starter hommealone

    (@hommealone)

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘p tag added after closing raw shortcode’ is closed to new replies.