Page MenuHomePhabricator

Newlines after bolded text in tables lost on save
Closed, ResolvedPublic


Steps to reproduce

  • Create a table with VE (or edit an existing one)
  • In a table cell, insert two lines of text (separated by a single return)
  • bold the first line
  • save (or preview the wikitext)

Expected result

The newline is preserved in wikitext, with a <br/> or a paragraph.

Actual result

The newline is lost, and the line serializes as

|'''bold'''second line

Event Timeline

GWicke raised the priority of this task from to Needs Triage.
GWicke updated the task description. (Show Details)
GWicke added a project: VisualEditor.
GWicke added subscribers: GWicke, Krenair.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 26 2015, 10:20 PM

@Jdforrester-WMF, @Catrope: Is this a generic issue for all annotations? What kind of content can it potentially drop after an annotation?

Wait, how is this related to link continuation?

Jdforrester-WMF reopened this task as Open.Aug 4 2015, 8:45 PM

False merge.

Huh. Parsoid issue maybe?

GWicke set Security to None.
Jdforrester-WMF triaged this task as High priority.Aug 10 2015, 8:27 PM

Minimal failing test case for Parsoid:




Interestingly if a newline character is inserted between </b> and <p> in the HTML the bug goes away.

ssastry added a subscriber: ssastry.Dec 4 2015, 7:31 PM

Must be some broken newline constraint in the serializer .. or at least an unhandled edge case.

This is a more general issue:

[subbu@earth bin] echo '<b>Foo</b><p>bar</p>' | node parse --html2wt

With --debug wts, we see this:

[SEP]        |   constraint | sibling | <B,P> | {"a":{},"b":{"min":0,"max":2},"min":0,"max":2} | "<b>Foo</b>" | "<p>bar</p>"


[subbu@earth bin] echo 'Foo<p>bar</p>' | node parse --html2wt


which in --debug wts mode shows:

[SEP]        |   constraint | sibling | <#text,P> | {"a":{},"b":{"min":2,"max":2},"min":2,"max":2} | "Foo" | "<p>bar</p>"

So, looks like some unhandled scenario in computing newline constraints for P-tags

Change 257032 had a related patch set uploaded (by Subramanya Sastry):
T104032: Fix html2wt newline constraints for paragraphs

Change 257032 merged by jenkins-bot:
T104032: Fix html2wt newline constraints for paragraphs

ssastry closed this task as Resolved.Dec 17 2015, 5:41 PM
ssastry removed a project: Patch-For-Review.
ssastry edited a custom field.
ssastry removed a subscriber: gerritbot.