Make WordPress Core

Opened 3 years ago

#52308 new defect (bug)

WordPress Editor does not preserve "blank" (empty) lines in Code/Text mode

Reported by: darko-a7's profile Darko A7 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: javascript Cc:


This issue exists in WordPress Classic (TinyMCE) Editor for ages, and similar issue exists in new Block editor, when used in Code mode.

I will try to explain it as briefly as possible, but there's a video attached for a quick demonstration, as well.

1) WordPress Block Editor

  • Switch to Code mode
  • Type a lot of html text with some tags (e.g. h3, h4, h5 sections and paragraphs)
  • Whenever you insert an empty line between title tags (h1-h6), on scroll action Editor will remove them! This condenses all the text and makes our brains short circuiting e.g. we can no longer easily visualize different paragraphs and sections when working with huge amount of text / lengthy articles!

This behavior should be fixed / js code that is doing this must be optional and left disabled, if we desire so. Or removed completely, as it is counter-intuitive and counter-productive.

2) WordPress Classic Editor

  • Situation with Classic editor is little better. As long as we stay in Text mode, editor will keep our line spacings between header titles/tags and other tags and paragraphs.
  • However, as soon as we switch to Visual Editing mode, and update the article, all the line spaces / "custom formatting" will be lost! Now, I need to switch on occasion to Visual, but I like to mostly work in Text mode, because of full control and freedom.

The HTML output produced in Code/Text modes does not actually change, so this annoying thing is not even justified by WYSIWYG standard e.g. it does not affect the end result. But it makes our lives miserable with the editor's mind of its own.

To be honest, I'd like to have a simple editor, much like this one we have here on Track during posting issues. It presents us with a plain textarea input and commands on top, and that's it! It works.

Please see attached video for illustration.


Attachments (1)

Change History (1)

Note: See TracTickets for help on using tickets.