Last modified: 2014-09-15 17:31:21 UTC
Intention: Add a new paragraph at the bottom of a page that ended in == <nowiki/> == (not counting the category after the empty section heading). I was hoping that adding a new paragraph underneath the blank section heading would allow me to select, and therefore to remove, the blank section heading. Steps to Reproduce: 1. Edit a page that ends in a == <nowiki/> ==, like https://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox2&oldid=589158823 2. Place the cursor in the empty section heading. 3. Hit return. Actual Results: Pressing return adds blank paragraphs *above* the empty section heading. If you type anything into the section heading, then it starts behaving normally. Expected Results: Doing the same thing for an empty (or non-empty) section heading anywhere else on the page adds new paragraphs *under* the empty section heading. Pressing return in a section heading should produce the same behavior everywhere on the page. Reproducible: Always
This is also reproducible with other block nodes, like preformatted text. There's code in ve.ce.Surface#handleEnter to "If we're at the start/end of something that's not a paragraph, insert a paragraph before/after". The quirk is that it checks for the "at the start" case before checking the "at the end" case, and for empty elements both of these are true. Let's just flip the order.
Change 160215 had a related patch set uploaded by Bartosz Dziewoński: ve.ce.Surface: Insert new paragraphs after empty nodes rather than before https://gerrit.wikimedia.org/r/160215
Change 160215 merged by jenkins-bot: ve.ce.Surface: Insert new paragraphs after empty nodes rather than before https://gerrit.wikimedia.org/r/160215