Opened 8 years ago
Last modified 6 years ago
#39574 new defect (bug)
Editor patterns: add empty headings/quotes
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | Editor | Keywords: | needs-patch |
Focuses: | Cc: |
Description
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:
<h2></h2> Test
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.
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.