Syntax Lang Auto-detect and wp:code transforming
-
Hi!
We have a lot of blocks without a class that could help to detect language.Just wp:code and it displays by default
Screenshot -> https://take.ms/IjN18
ExampleAlso, some blocks have that class. e.g. Screenshot -> https://take.ms/FzcKF
ExampleHere it’s interesting Copy button appears (looks like prism.js functionality), but not highlighting.
Of course, if I put Prismatic block and define a lang – it all works.
My questions:
1. Is there a way to auto-detect the language? I read that highlight.js supports that but I didn’t manage to make it work with the plugin2. Do you have a recipe for converting wp:code blocks to Prism blocks? Or maybe a feature? And of course, it makes sense (if no auto-detect) for blocks with a defined lang class. If no feature is planned/possible was thinking about writing a script (just need to debug it carefully ?? not to ruin content )
Many thanks for your work!
The page I need help with: [log in to see the link]
- The topic ‘Syntax Lang Auto-detect and wp:code transforming’ is closed to new replies.