diff --git a/blocks/library/index.js b/blocks/library/index.js index ac6c0b2c20d20..17e7534aa35cd 100644 --- a/blocks/library/index.js +++ b/blocks/library/index.js @@ -35,6 +35,26 @@ import * as video from './video'; export const registerCoreBlocks = () => { [ + // FIXME: Temporary fix. + // + // The Shortcode block declares a catch-all shortcode transform, + // meaning it will attempt to intercept pastes and block conversions of + // any valid shortcode-like content. Other blocks (e.g. Gallery) may + // declare specific shortcode transforms (e.g. `[gallery]`), with which + // this block would conflict. Thus, the Shortcode block needs to be + // registered as early as possible, so that any other block types' + // shortcode transforms can be honoured. + // + // This isn't a proper solution, as it is at odds with the + // specification of shortcode conversion, in the sense that conversion + // is explicitly independent of block order. Thus, concurrent parse + // rules (i.e. a same text input can yield two different transforms, + // like `[gallery] -> { Gallery, Shortcode }`) are unsupported, + // yielding non-deterministic results. A proper solution could be to + // let the editor (or site owners) determine a default block handler of + // unknown shortcodes — see `setUnknownTypeHandlerName`. + shortcode, + audio, button, categories, @@ -57,7 +77,6 @@ export const registerCoreBlocks = () => { quote, reusableBlock, separator, - shortcode, subhead, table, textColumns,