Page MenuHomePhabricator

in Special:ContentTranslation, deleting a whole section heading adds an unnecessary <br> in the end
Closed, DuplicatePublic1 Story Points

Description

To reproduce:

  1. Start translating https://en.wikipedia.org/wiki/William_Daniel_Phillips
  2. Click the "Biography" section heading.
  3. Press Ctrl-A to select the whole heading. Press delete the heading's text. If you inspect the element, you'll see that the text disappears and is replaced by <br />
  4. Type a new heading: "Biografia". If you inspect the heading, you'll see that the <br /> is in the end of the text.
  5. Publish the article.

Expected:

== Biografia ==

Actual:

== Biografia<br>
 ==

This also causes the heading to be displayed incorrectly.

I'm not sure whether this is something that must be fixed in ContentTranslation or auto-normalized by Parsoid.

Tested in Firefox on Fedora.

Event Timeline

Amire80 created this task.May 20 2015, 10:44 PM
Amire80 raised the priority of this task from to Needs Triage.
Amire80 updated the task description. (Show Details)
Amire80 added subscribers: Amire80, santhosh.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 20 2015, 10:44 PM
Amire80 renamed this task from in Special:ContentTranslation, deleting a whole section heading adds an unnecessary <br /> in the end to in Special:ContentTranslation, deleting a whole section heading adds an unnecessary <br> in the end.May 20 2015, 10:44 PM
Amire80 set Security to None.

This seems to happen in all paragraphs and not just section headings, but in usual <p> paragraphs it doesn't cause messy syntax output.

I think we need to clean it up as a preprocessing step before save/publish

Change 212774 had a related patch set uploaded (by Santhosh):
Publish preprocessing: Remove the empty br tags inserted by Firefox

https://gerrit.wikimedia.org/r/212774

santhosh claimed this task.May 25 2015, 4:05 AM
santhosh triaged this task as Normal priority.

Change 213580 had a related patch set uploaded (by Amire80):
Remove unnecessary <br> from the end of text using .replace()

https://gerrit.wikimedia.org/r/213580

Change 213580 abandoned by Amire80:
Remove unnecessary <br> from the end of text using .replace()

Reason:
Santhosh's patch is better.

https://gerrit.wikimedia.org/r/213580

Change 212774 merged by jenkins-bot:
Publish preprocessing: Remove the empty br tags inserted by Firefox

https://gerrit.wikimedia.org/r/212774

santhosh closed this task as Resolved.May 27 2015, 7:18 AM
santhosh added a project: LE-Sprint-87.
santhosh moved this task from Backlog to Done on the LE-Sprint-87 board.
santhosh edited a custom field.Jun 9 2015, 8:04 AM