Page MenuHomePhabricator

VisualEditor frequently adds <br /> to articles
Closed, DuplicatePublic

Description

As reported on the German-language Wikipedia's feedback page, the VisualEditor frequently add an unnecessary <br /> tag to articles:

According to the reporting user @Wurgl there are thousands of these cases.

Event Timeline

If the user enters multiple linebreaks, this is the correct wikitext.

This could be T215002: New paragraph before section heading becomes line break (well, the first example doesn't have the new section above a heading, but it's probably still related).

I do not understand why this one is merged?

Here a <br /> is added at the end of a section. This is caused by different behavior of the source editor and the visual editor.

In the source editor when you edit a single section, you can add as much newlines at the end, as you want. When finishing the edit, that newlines at the end vanish (either the browser does not send them or the software eats them).

In VE those newlines are magically transformed into <br />. Those <br /> should be considered as a temporary workaround caused by "What you see is what you get" and should vanish.

Every day there are about 10 pages with these nasty breaks.