File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/code/block-definition Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,15 @@ const selectLanguageOptions: ReadonlyArray< {
7676 */
7777// eslint-disable-next-line @typescript-eslint/no-explicit-any -- No good interface available for this type now.
7878function filterBlockRegistration ( settings : any ) {
79- // Our transform is better than the transform provided by syntaxhighlighter/code.
80- // Remove thier transform.
81- if ( false && settings . name === 'syntaxhighlighter/code' ) {
79+ /*
80+ * The enhanced code block includes a "from" transform that handles things like language
81+ * name, line number settings, etc. Remove the "to" transform provided by syntaxhighlighter/code
82+ * so that simpler trnasform is not applied.
83+ */
84+ if ( settings . name === 'syntaxhighlighter/code' ) {
8285 if ( settings . transforms ?. to ) {
8386 settings . transforms . to = settings . transforms . to . filter (
84- transform =>
87+ ( transform : { type : string ; blocks ?: unknown } ) =>
8588 ! (
8689 transform . type === 'block' &&
8790 Array . isArray ( transform . blocks ) &&
You can’t perform that action at this time.
0 commit comments