Unnecessary 4 spaces added when pressing <enter> in HTML block when editing

Whenever you are editing an HTML section of a post and you press <ENTER>, a new line along with 4 spaces are added. Why? In HTML those spaces are irrelevant. No spaces should be added…

This behavior can be avoided by holding SHIFT when pressing enter, but it shouldn’t have to be done.

The spaces are autoformatting provided by the upstream dependency (codemirror) to make it easier for you to write your code. The indenting is automatically updated based on thecontext (try creating a <div> tag, and then add the closing </div> after your linebreak - the </div> will switch from a 4-space indent to a 0-space indent)

Thanks for the explanation. It is annoying when I am working with paragraph tags and I don’t want to always have to have the end </p> tag right at the end of the content… but I suppose it is something I’ll have to live with for now. Thanks for your help! :smiley:

Thank you HappyThoughs. I couldn’t figure out how to add to a paragraph or list without adding a space between the lines. SHIFT / ENTER did the trick. This should be added to the Ghost “Using the Editing” documentation.