Skip to content

Commit 16e4266

Browse files
authored
Merge pull request #102 from sirbrillig/add-code-transform
Add transforms to/from core code block
2 parents a75f027 + 29e9f52 commit 16e4266

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/blocks.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ registerBlockType( 'syntaxhighlighter/code', {
101101
},
102102
},
103103
},
104+
{
105+
type: 'block',
106+
blocks: [ 'core/code' ],
107+
transform: ( { content } ) => {
108+
return createBlock( 'syntaxhighlighter/code', { content } );
109+
},
110+
},
111+
],
112+
to: [
113+
{
114+
type: 'block',
115+
blocks: [ 'core/code' ],
116+
transform: ( { content } ) => {
117+
return createBlock( 'core/code', { content } );
118+
},
119+
},
104120
],
105121
},
106122

0 commit comments

Comments
 (0)