How to transform from code-block-pro to code blocks
zoyinc opened this issue · comments
Hi
Any plugin block that is used within posts can be a problem if support ends for that block - you have to go through every post where the block is and transform it to another block.
I see you added the feature "Add alternate way to transform from core block", and I am using this and it works great as a way to transform from code blocks to code-blocks-pro. Often this involves transforming from another plugin block -> code block -> code-blocks-pro.
I am thinking ahead to a time, potentially years away, when support for code-blocks-pro might end. To that end I cannot find a way to transform from your blocks back to code blocks, so the reverse of "Add alternate way to transform from core block".
Have I missed something, is there anything in the works, could it be a feature?
Thanks again for a great plugin.
Often this involves transforming from another plugin block -> code block -> code-blocks-pro.
What block are you coming from? I could probably add direct support for that one.
I am thinking ahead to a time, potentially years away, when support for code-blocks-pro might end. To that end I cannot find a way to transform from your blocks back to code blocks, so the reverse of "Add alternate way to transform from core block".
I could add this too. Alternatively, you could just convert it to HTML and it would save the styling as well (minus padding I think). You can test that now by just deactivating the plugin and pressing "convert to html"
Any plugin block that is used within posts can be a problem if support ends for that block - you have to go through every post where the block is and transform it to another block.
I'd like to add a way to mass convert in both directions, but it's a lot of work and I think WordPress will solve this eventually. WP has "synced patterns" coming in 6.3, but it doesn't include excluding specific parts of a sync. I spoke with some of the team working on it and they do plan to add support for this eventually. With this feature, you would be able to add a single "synced pattern" that has all the code block settings in place, but then exclude the code itself, maybe line number highlights, etc (things you don't want to sync globally). Depending on how WordPress implements this, it could be possible to convert all blocks in one go. Let's see. Regardless though, you'd have to go back and update your existing blocks. WordPress is changing rapidly though so I guess it's expected.
Happy to answer any questions you have, and if you have any feature requests let me know too.