Browser: Chrome
OS: macOS
Video: https://imgur.com/a/bricks-bug-1-11-1-1-broken-js-shortcode-tabs-nestable-TJW4XIh
When using a somewhat weird combination of a shortcode with a Tabs (Nestable) element, JavaScript code inside the shortcode breaks.
Preparation
- Add this code to your functions.php or anywhere else
add_shortcode("broken_shortcode", function ($args) {
return "<script>\n" .
" // This script is broken\n" .
" // </div>\n" .
"</script>\n";
});
- Add this shortcode inside a “Tabs (Nestable) > Shortcode” Bricks-element:
[broken_shortcode]
Expected output
<script>
// This script is broken
// </div>
</script>
Actual output
<script>
// This script is broken
// </script></div>
As you can see, the Closing Script tag moved to the wrong place, breaking the whole page.