Title: Insert code into div
Last modified: March 13, 2017

---

# Insert code into div

 *  Resolved [Shot511](https://wordpress.org/support/users/shot511/)
 * (@shot511)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-code-into-div/)
 * 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 9 years, 2 months ago by [Shot511](https://wordpress.org/support/users/shot511/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-code-into-div/#post-8911498)
 * 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](http://media.andidittrich.de/2017/03/enlighter_div_wrapper.png)
 * 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 9 years, 2 months ago by [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/).
 *  Thread Starter [Shot511](https://wordpress.org/support/users/shot511/)
 * (@shot511)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-code-into-div/#post-8911550)
 * 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.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Shot511](https://wordpress.org/support/users/shot511/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/insert-code-into-div/#post-8911550)
 * Status: resolved