Page MenuHomePhabricator

Whitespace inside HTML comments in transclusion parameters are lost on editing(?)
Closed, DuplicatePublic8 Estimated Story Points

Description

Sample diff

Expected behavior: the comment should stay unmodified

Actual behavior: blank lines have been removed

Event Timeline

I am not sure this is necessarily a Parsoid issue. I think VE might have dropped the comment during the edit of the parameter or could have been an editor issue where the editor might have unintentionally deleted the comment while updating the parameter.

Right now, Parsoid considers that comment as part of the template parameter and encodes it as such. So, this could be considered a Parsoid issue if the current representation of the comment is considered inadequate for preserving them. I am not convinced that we need to change the representation since I can imagine those changes replacing this "edge case" with other edge cases.

So, I am inclined to classify this as a VE / user-error rather than a Parsoid issue.

ssastry renamed this task from HTML comments blank lines are slurped by Parsoid to HTML comments and blank lines in an edited transclusion are lost during the edit.Jun 27 2016, 4:08 PM
Jdforrester-WMF renamed this task from HTML comments and blank lines in an edited transclusion are lost during the edit to Whitespace inside HTML comments in transclusion parameters are lost on editing(?).Aug 9 2016, 7:13 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 8.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

This is actually caused by TemplateData for that template parameter specifying it is a single-line text. We've just fixed a duplicate this issue filed as T190191: Line-breaks between list-items in template parameters are removed. :)

Though do note, I think this'll still happen if it's a comment next to any more-specific TemplateData type. I.e. a comment after a boolean is going to get thrown away because the value will get coerced into a checkbox, etc.