• Hello, my name is Ben and I have been using WordPress for about 4 years.
    I need help regarding the Gutenberg Editor. It has a <code> block for forum posts but it is quite hard to use, because it does not support indent formating, because pressing tab does not work. I have seen forum posts regarding this topic, which are about 5 years old, so I assume, that there is no actual solution to this issue yet. I would love to use TAB-indent in code blocks.

    Is there a way I can fix this on my own in the mean time? Inserting a JS-Script, installing a plugin, pressing something like CTRL+Shift to indent instead.

    Yes I am aware, that you can preformat the code in another program and paste it. I also have a plugin called „Syntax-highlighting Code“, which helps with the formating in terms of coloring. The library Prism.js helps with that as well.

    But code with no indent is not getting any indent after the plugin or js library either.

    I would love to hear some suggestions and if WordPress / Gutenberg Editor Developers will add a feature for this eventually!

    Thank you so much!
    Ben

Viewing 1 replies (of 1 total)
  • Moderator threadi

    (@threadi)

    I totally understand your concern. For me, the code block is also important for displaying code correctly, including indentation. Unfortunately, the code block in the Block Editor doesn’t support this, but there’s a simple reason for that: the Tab key is used to navigate between browser and editor components. Therefore, it can’t be used for indentation at the same time.

    However, this can definitely be worked around. In the List Block, you can indent sub-items using the Tab key. I’m just unsure if and how this could be made possible in an environment like the Block Editor.

    At the moment, I see the following options for you:

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.