Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Dmytro Shteflyuk

    (@kpumuk)

    I am still investigating. There are reports of some issues, and I am in the progress of investigating.

    Thread Starter Chuckie

    (@ajtruckle)

    Ok, I look forward to your update.

    Plugin Author Dmytro Shteflyuk

    (@kpumuk)

    The easiest way at to make it work at the moment is to use “shortcode” block, and insert the value in form:

    [cc lang="php"]
    $x = "10";
    [/cc]
    Thread Starter Chuckie

    (@ajtruckle)

    Sure. I did several blocks and have email you about issues. Or started questions here. I can’t remember.

    Plugin Author Dmytro Shteflyuk

    (@kpumuk)

    Yeah, I see them now. Will investigate!

    Thread Starter Chuckie

    (@ajtruckle)

    Thanks.

    What I did was use a Custom HTML Block and then within that do something like:

    
    <code lang="PHP">
    ...
    </code>
    

    It also looks like with the latest Gutenberg Version, inline code seems to work with a normal paragraph block when editing it as HTML:

    
    <p>Another paragraph. I am typing more stuff in to get an auto save.&nbsp; Blah, blah. <code inline="true">This is code.</code></p>
    
    Thread Starter Chuckie

    (@ajtruckle)

    MarkRH but that won’t have all the syntax hilighting will it?

    I await resolution from the author. I think it merits a bespoke rendered block for the editor.

    Thread Starter Chuckie

    (@ajtruckle)

    Any official update? I version 5 is out now.

    Thread Starter Chuckie

    (@ajtruckle)

    Any update to my queries? Thank you.

    @ajtruckle

    Yes, it keeps the syntax highlighting. Screenshot: https://i.imgur.com/fqkDsPi.png

    Was done with the following code in a normal Gutenberg Paragraph block:

    
    <p>This is a normal paragraph block.&nbsp; Following is some inline PHP: <code inline="true" lang="php">print_r($arItems[$itemCount]);</code>and this is normal text after.</p>
    

    For blocks of code, I use the Custom HTML Block like I mentioned earlier. The standard “Code” block introduces some of the built-in styling which is unwanted. Anyway, v0.9.16 works fine here in the cases that I use it.

    Thread Starter Chuckie

    (@ajtruckle)

    I changed all of the blocks to custom HTML blocks and used the <code> approach. Visually the published post looks ok.

    But it is when I edit the post that it comes up with all those issues again and I have to click the “convert to html” button above each block. Which is annoying.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Gutenberg editor’ is closed to new replies.