More… I just tried putting the code into a custom HTML block and it remains as i put it, without getting changed by the editor. Maybe if the editor is set to the code editor the default block type could be custom HTML instead of Classic? Something to think about.
Something is quirky here though, because after i’ve created some code in a custom HTML block, if i remove the block tags then the block reverts to Classic, and after that my code does not get modified when saving of switching between code and visual. Not very consistent behavior.
Hi,
We’ll not be changing the default editor, since the idea is backwards compatibility and putting it into the classic block is perfect for this.
The reason it converts to classic is because the block tags are what tells Gutenberg that this is a block made in Gutenberg. If there are no block tags, it reads it as coming from the classic editor and pops it into the classic block for backwards compatibility.
Basically, editing out the block “wrappers” will cause weird behavior that we honestly can not account for beyond reverting to the classic block and hoping all goes well (as block content is not always usable in the classic editor this may lead to unexpected behaviors).
Hi Marius –
I think the general concept of using a classic editor block as the default is a good one, but the implementation is less than ideal. There would probably be a lot fewer complaints if all the functionality of the classic editor (with some exceptions) remained available when it’s being used in a block – notably the ability to insert images (including in the code editor).
Having GB block wrappers show up in the code editor is not a show stopper, but losing whitespace creates a significant usability problem.
I’m not happy with the current state of Gutenberg because it gets hugely in the way of productivity. What it would take for me to adopt it is for all of the current functionality of the classic editor to remain available and for blocks to be optionally available as extra functionality for quickly creating more complex content – using Gutenberg only as a content templating system and not trying to shoehorn traditional word processing functionality into blocks.
For me the concept of using a block to basically just create an HTML tag is ridiculously dysfunctional. Using blocks for headings, paragraphs, blockquotes, and lists is overkill and inferior to traditional ways of inserting such content.
There may be a good case for using image blocks because it makes possible separate instances of image meta data like captions, but removing word-processor-style image insertion breaks backward compatiility.
I concede however that it may be better functionality to create and manipulate compound tags like tables using blocks.
What whitespace-loss are you referring to? The classic block should not lose anything, and should ideally be a straight 1-to-1 representation of what you have today, so if there’s anything lost in that transition that’s something we’ll want to look into of course.
Here’s how you can reproduce what i’m talking about.
Open up the Sample Page in Gutenberg. Switch to the code editor. Insert blank lines between the paragraphs and blockquotes. I always put space between blocks to make it easier to read when i’m editing.
Now simply click the preview or update button and watch that space get removed.
Got’cha.
So that’s part of the cleanup process that runs automatically to prevent any invalid parsing when there’s non-standard content between blocks, I’m not sure if we’ll be making any modifications to this behavior, but I’ve at least mentioned the concern to the developers 🙂
I’m adding on here since the last point discussed about “whitespace” is an issue I’m currently dealing with. Within the Classic Block, when the contents contain paragraphs with non-breaking spaces in them, the (let’s call them) spacer paragraphs are retained when Gutenberg is initially activated (and original contents are converted to a Classic Block). However once you edit the Classic Block (not even converting to Gutenberg Blocks) the spacer paragraphs are wiped out. This drastically collapses pages where lots of these spacer paragraphs exist (ex. <p> </p>
. There is no way to edit the original contents and retain the original spacing without converting to blocks and adding spacer blocks.
Hiya @clenfert,
This is another users topic, and it is now more than 2 months old, please create your own topic as per the Forum Guidelines, so that we don’t overburden the original poster with notifications 🙂