• Resolved Shot511

    (@shot511)


    Hey,

    Is there a way to insert Enlighter’s shortcodes into a div? I’m using a text-html editor and would like to do the following thing:

    <div>
        [cpp]Some code[/cpp]
    </div>

    But the Enlighter’s code escapes the div when I preview the page/post.

    • This topic was modified 7 years, 12 months ago by Shot511.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andi Dittrich

    (@andi-dittrich)

    Dear Shot511,

    it should work without any issues. The shortcode is replaced by a <pre> tag which contains your RAW code. On the Browser, the EnlighterJS Processor sets this container to invisible and inserts the highlighted code as <div> container above the <pre> container. Working Exmaple

    This means the code around the shortcode will not be altered by the plugin – BUT in case you use the legacy-shortcode-processor instead of the Enlighter’s one, you have to take care of all special chars inside the [cpp] block by yourself – otherwise some of the WordPress HTML filters may alter/merge the code

    best regards, Andi

    • This reply was modified 7 years, 12 months ago by Andi Dittrich.
    Thread Starter Shot511

    (@shot511)

    Thanks for a hint, it works well now ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insert code into div’ is closed to new replies.