#3907 closed defect (bug) (fixed)
Gutenberg runs wpautop before Syntaxhighlighter runs its shortcodes
Reported by: | pento | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | General | Keywords: | needs-patch |
Cc: |
Description
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
.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Since this is an external, instead of patching the plugin, I added a mu-plugin to override the priority of that filter. If the plugin itself is changed, then we can simply remove the mu-plugin file.
Fixed in [dotorg:14535].