Page MenuHomePhabricator

Remove "empty section" tag from sections that are not empty (AWB)
Open, Needs TriagePublic

Description

Currently, AWB adds "empty section" template in the empty sections of mainspace articles (if the header for section exists). But there are often some sections with the "empty section" template which consist a line or two.

If AWB could remove the empty section tag from such sections, and/or replace it with "expand section", it would be great.

More details can be found in this discussion: https://en.wikipedia.org/w/index.php?title=Wikipedia:Bot_requests&oldid=1053037092#"Empty_sections"_that_are_not_empty

Thanks,
usernamekiran.

Event Timeline

The problem is that in many cases we have noticed single characters vandalism within a section.

And another problem is that some sections contain only templates. They can be either empty or not.

Maybe if we tell AWB to ignore other templates, and assign a character length, then it can be handled while editing?
I am not sure about other editors, but I generally check the changes in edit box. Especially if edit summary says "removed stub tag".
So whenever there is summary "replaced empty section with expand section", the editor should check for the section itself for the issues described by you.

Suggested code to remove empty sections followed by another level 2 section:
== *(?:Bibliography|Further reading|Gallery|Notes|See also|External links) *==\s*(?:\{\{empty section\|date\=[A-Za-z]+ \d{4}\}\}\s*)?(== ?[A-Z]) --> $1

Suggested code to remove empty sections followed by DEFAULTSORT or a category:
== *(?:Bibliography|Further reading|Gallery|Notes|See also|External links) *==\s*(?:\{\{empty section\|date\=[A-Za-z]+ \d{4}\}\}\s*)?(\{\{DEFAULTSORT|\[\[Category) --> $1