1. Weston Ruter

    There is still some debate about the best way to provide syntax highlighting in Gutenberg. Another implementation called Code Syntax Block by Marcus Kazmierczak, extends Gutenberg’s existing code block to offer syntax highlighting, instead of creating a new block for it. It also uses PrismJS syntax highlighter.

    Yet another way to provide syntax highlighting is to do it server-side via PHP instead of using PrismJS to do it client-side with JS. Doing it server-side has the benefit of improving frontend performance. It also works with JS disabled. For more details, see this PR: https://github.com/mkaz/code-syntax-block/pull/13


  2. Stephen Vaughan

    Mmmm? So we potentially have a way to present nice looking code to visitors on the front end but a pretty crappy developer’s experience on the back when they want to view the html of blocks.

    Says a lot about WordPress going forward with the block editor.


  3. Matt

    To be clear, we pulled the syntax highlighting out because of accessibility concerns. I’m looking forward to bringing it back in once CodeMirror 6 is out.


  4. WPSelected

    Highlighted and colored lines would be great but I’m more than OK with just a proper view of lines!


  5. Stagger Lee

    I believe it is not the first one with Gutenberg support ?



Comments are closed.

%d bloggers like this: