• Resolved yanch

    (@yanch)


    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
    Example

    Also, some blocks have that class. e.g. Screenshot -> https://take.ms/FzcKF
    Example

    Here 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 plugin

    2. 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]

Viewing 1 replies (of 1 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help:

    1) There might be but it’s not implemented in the plugin at this point.

    2) It’s a great idea, not something I have spent time on though. If you want to write something up, I would be glad to help test and implement if all looks good.

    Let me know if I can provide any further infos!

Viewing 1 replies (of 1 total)
  • The topic ‘Syntax Lang Auto-detect and wp:code transforming’ is closed to new replies.