Page MenuHomePhabricator

Section editing: removing sections leaves excess whitespace
Closed, ResolvedPublic

Description

Author: mike.lifeguard+bugs

Description:
When removing an entire section using section editing, excess whitespace is left behind. This is an annoyance especially when archiving section-by-section, and necessitates an extra edit at the end of an archive run to remove extra blank lines. Upon saving an empty section, a check should be done that extra lines are not being left behind - if so, remove them silently to avoid this issue.


Version: 1.14.x
Severity: normal

Details

Reference
bz14938

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:09 PM
bzimport set Reference to bz14938.
bzimport added a subscriber: Unknown Object (MLST).

(Note that the lines don't hurt anything -- there's no actual reason to go back and remove them in a second edit.)

mike.lifeguard+bugs wrote:

Except that when you remove several sections together, the added newlines end up leaving excess whitespace in the rendered page, which is ugly.

mail wrote:

(In reply to comment #0)
I'd like to support Mike.lifeguards' idea. I also find it annoyiung when a blank line ist left after removing a section.

mike.lifeguard+bugs wrote:

IIRC, some similar check is done within edit summaries - if the last character is a space, silently drop it. Similarly here - the newlines are useless, so please have them silently stripped upon save.

mike.lifeguard+bugs wrote:

Bug 16116 related

bluehairedlawyer wrote:

Don't add newlines when the section is blank

This is very easily fixed. These are newlines that the program adds in by default. Under this patch we don't add them in when the section is empty.

Attached:

Patch applied in r46684. Thanks.