GWicke has submitted this change and it was merged.

Change subject: [Bug 42667]: Treat HTML-pres with 1 opening newline specially.
......................................................................


[Bug 42667]: Treat HTML-pres with 1 opening newline specially.

* Browsers always strip the leading newline in a html-pre.  So,
  this makes it hard for the visual editor to distinguish between
  <pre>foo</pre> and <pre>\nfoo</pre>.  It can detect 2+ newline
  case since a newline is left behind.  See [Bug 42667] for details.

* When html-pre has a single leading newline, it is stripped and
  info recorded in data-parsoid.

* Consolidated indent-pre and html-pre handling in the DOM into
  a single post-processor.

* 3 wt2wt test fails because of the --wt2wt testing mode.

  For example, this wikitext adds an extra newline.
  echo "<pre>\n\nfoo</pre>" | node parse.js --wt2wt

  But, this command RTs correctly.
  echo "<pre>\n\nfoo</pre>" | node parse.js | node parse.js --html2wt

  TODO: Fix parserTests --wt2wt testing mode to serialize DOM to
  HTML and reparse it before running --html2wt mode on it.

* Some JSHint fixes.

Change-Id: I8fbef7f075bcb929e934672ccecc0bc636d7e9b0
---
M js/lib/mediawiki.DOMPostProcessor.js
M js/lib/mediawiki.WikitextSerializer.js
2 files changed, 94 insertions(+), 41 deletions(-)

Approvals:
  GWicke: Verified; Looks good to me, approved
  jenkins-bot: Looks good to me, but someone else must approve


--
To view, visit https://gerrit.wikimedia.org/r/36923
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fbef7f075bcb929e934672ccecc0bc636d7e9b0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to