Make WordPress Core

Opened 4 years ago

Last modified 18 months ago

#39574 new defect (bug)

Editor patterns: add empty headings/quotes

Reported by: mahu2401 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.3
Component: Editor Keywords: needs-patch
Focuses: Cc:


Currently some patterns normally only work if there's other text after the leading character(s). I you type ## Test and press enter, a new h2 element will be created. If you type ## followed by zero or more spaces, no heading is added and the ## stays "normal" text. I think this is and should be the intended behaviour, so no empty elements are created.
But if yout enter ## Test, then move the cursor between ## and Test followed by pressing enter, an empty heading will be created and the resulting html looks like this:


Until switching to the text editor and back, you are not able to add text to the heading because it doesn't show up in visual mode.

When doing the same with >, it doesn't create an empty blockquote, but removes the leading char. The visual editor is then adding an additional line of whitespace, where you can't put your cursor in. This line disappears also after switching to text mode and back.

I've tested with WP 4.3 and 4.7.1.

Change History (1)

#1 @andraganescu
18 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Yes I can reproduce this behaviour as well. The fix should add a place where we could place the cursor to edit the empty heading.

Note: See TracTickets for help on using tickets.