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


#1

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.


#2

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)


#3

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: