Transform to code (or other block types)
-
Hi,
I’m working on migrating a custom CMS to WordPress and giving Gutenburg a spin. So far it’s ok, but I’m having problems with the “Convert To Blocks” and “Transform To” function.
I have a post imported (via custom logic using wp_insert_post). Within the post there are pre tags containing sourcecode. I would like these to be converted to code blocks when using “Convert To Blocks”.
I can change what the pre tags are if there is one that is automatically gets converted to code. code does not convert either, pre has better formatting so I used that.
Failing that, I can use the “Transform to” option, but I can only go from paragraph to preformatted and back. How do I transform a paragraph or preformatted block to a code block? I can add a new block and copy & paste the code, but that isn’t realistic for 600+ pages with upto 8 sourcecode snippets.
Development version (5.0-RC1-43945).
Thanks
- The topic ‘Transform to code (or other block types)’ is closed to new replies.