Title: syntax highlighting
Last modified: August 21, 2016

---

# syntax highlighting

 *  [mxmanuel](https://wordpress.org/support/users/mxmanuel/)
 * (@mxmanuel)
 * [12 years ago](https://wordpress.org/support/topic/syntax-highlighting-1/)
 * I have set up some shortcodes in my functions.php to be used in the editor and
   would love to highlight them in the editor.
    Is that possible and if so: how?
 * Here is what I set up in my functions.php:
 *     ```
       /* Open Div */
       add_shortcode('div', 'be_div_shortcode');
       function be_div_shortcode($atts) {
       	extract(shortcode_atts(array('class' => '', 'id' => '' ), $atts));
       	$return = '<div';
       	if (!empty($class)) $return .= ' class="'.$class.'"';
       	if (!empty($id)) $return .= ' id="'.$id.'"';
       	$return .= '>';
       	return $return;
       }
   
       /* Close Div */
       add_shortcode('end-div', 'be_end_div_shortcode');
       function be_end_div_shortcode($atts) {
       	return '</div>';
       }
        function shortcode_empty_paragraph_fix( $content ) {
   
               $array = array (
                   '<p>[' => '[',
                   ']</p>' => ']',
                   ']<br />' => ']'
               );
   
               $content = strtr( $content, $array );
   
               return $content;
           }
   
           add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );
       ```
   
 * Thanx for any answer
    mxmanuel
 * [https://wordpress.org/plugins/tinymce-advanced/](https://wordpress.org/plugins/tinymce-advanced/)

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

 *  Plugin Author [Andrew Ozz](https://wordpress.org/support/users/azaozz/)
 * (@azaozz)
 * [12 years ago](https://wordpress.org/support/topic/syntax-highlighting-1/#post-4930961)
 * Shortcodes in the editor are just plain text strings. There’s no direct way to
   highlight them.
 * Depending on how you want the users to interact with your shortcode in the editor,
   you can replace it with a “placeholder image” similarly to how the `more` and`
   nextpage` tags work.
 *  Thread Starter [mxmanuel](https://wordpress.org/support/users/mxmanuel/)
 * (@mxmanuel)
 * [12 years ago](https://wordpress.org/support/topic/syntax-highlighting-1/#post-4930966)
 * Thanks a lot for your response.
 * mxmanuel

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

The topic ‘syntax highlighting’ is closed to new replies.

 * ![](https://ps.w.org/tinymce-advanced/assets/icon-256x256.png?rev=971511)
 * [Advanced Editor Tools](https://wordpress.org/plugins/tinymce-advanced/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tinymce-advanced/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tinymce-advanced/)
 * [Active Topics](https://wordpress.org/support/plugin/tinymce-advanced/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tinymce-advanced/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tinymce-advanced/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mxmanuel](https://wordpress.org/support/users/mxmanuel/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/syntax-highlighting-1/#post-4930966)
 * Status: not a support question