[wp-trac] [WordPress Trac] #45684: Gutenberg breaks shortcode with nested parentheses

WordPress Trac noreply at wordpress.org
Mon Dec 17 22:36:44 UTC 2018


#45684: Gutenberg breaks shortcode with nested parentheses
--------------------------+-------------------------------------
 Reporter:  siggeste      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Shortcodes    |    Version:  5.0.1
 Severity:  critical      |   Keywords:  needs-patch ux-feedback
  Focuses:                |
--------------------------+-------------------------------------
 When inserting shortcode containing both single and double parentheses
 (like so: [plugin query="a='b' c=1"] ) using a Shortcode Block, Gutenberg
 will show a warning next time you load the page, saying that the Block
 contains unexpected or incorrect code. You can choose to "restore" the
 code by converting it to a Block (whatever that means in this context),
 completely wrecking your code, or you can convert it to Custom HTML in
 which case the single parentheses will be converted to double parentheses,
 breaking the HTML. This also happens when you insert the code into the
 page using Custom HTML right away. Either way, the shortdcode will not
 work properly and there's no way around it, using vanilla WP 5.0.

 The only solution I have found, is to install the Classic Editor Plug-In
 and then switch to Text View. That basically rules out the possibility of
 any of my editors being able to make and maintain pages containing such
 shortcodes, which is extremely not cool. (I'm classifying this as a Bug of
 Critical Severity, since it effectively breaks an essential plug-in of my
 site.)

 When saving the above code as a Reusable Block (I'm using WP with a Dutch
 translation so the exact term may differ), you get to see the resulting
 HTML. Everything between the single parentheses is replaced by a single
 line-break. Ouch.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45684>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list