[wp-meta] [Making WordPress.org] #3907: Gutenberg runs wpautop before Syntaxhighlighter runs its shortcodes

Making WordPress.org noreply at wordpress.org
Mon Nov 5 23:26:01 UTC 2018


#3907: Gutenberg runs wpautop before Syntaxhighlighter runs its shortcodes
---------------------+-------------------------
 Reporter:  pento    |      Owner:  (none)
     Type:  defect   |     Status:  new
 Priority:  normal   |  Milestone:
Component:  General  |   Keywords:  needs-patch
---------------------+-------------------------
 The Syntaxhighlighter plugin runs its shortcodes on `the_content` at
 priority 7, which is usually before `wpautop` runs, at priority 10.

 The Gutenberg plugin moves `wpautop` to priority 6, which causes all sorts
 of weirdness. You can see it easily fixed by applying this change:

 {{{
 Index: syntaxhighlighter.php
 ===================================================================
 --- syntaxhighlighter.php       (revision 1969451)
 +++ syntaxhighlighter.php       (working copy)
 @@ -43,7 +43,7 @@
                 load_plugin_textdomain( 'syntaxhighlighter', false,
 '/syntaxhighlighter/localization' );

                 // Display hooks
 -               add_filter( 'the_content',                        array(
 $this, 'parse_shortcodes' ),                              7 ); // Posts
 +               add_filter( 'the_content',                        array(
 $this, 'parse_shortcodes' ),                              5 ); // Posts
                 add_filter( 'comment_text',                       array(
 $this, 'parse_shortcodes_comment' ),                      7 ); // Comments
                 add_filter( 'bp_get_the_topic_post_content',      array(
 $this, 'parse_shortcodes' ),                              7 ); //
 BuddyPress
 }}}

 This bug should be fixed by switching from the Gutenberg plugin to
 WordPress 5.0, but a workaround would be a mu-plugin that changes the
 priority of `parse_shortcodes`.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/3907>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list