GWicke has submitted this change and it was merged.

Change subject: Selective serialization fixes: much simplified newline handling.
......................................................................


Selective serialization fixes: much simplified newline handling.

* Remodel final output as alternating chunks of unmodified-content
  and modified-content separated by chunks of newlines.  So, final
  output looks like [\n*, U1, \n*, M1, \n*, U2, \n*, M2, \n* ...]
  where all U and M chunks have no leading or trailing newlines.
  This means we dont have to worry about how or where newlines are
  coming from and always emit them as long as they are separators.

* Removed selser-specific newline logic from the regular serializer
  except for emitting nls and non-nl content separately.

* Updated selser to :
  - strip leading and trailing nls from unmodified source chunks.
  - detect transition between U and M chunks and emit incoming nls.
    in the following cases:
        (a) always when inside M chunks (this implicitly emits nls
            when transitioning from M to U).
        (b) when transitioning from U to M.

* Improved selser tracing for ease of debugging.

* Code cleanup and refactoring -- more to come.

* Added sanity check to unmodified source recorder (there are bugs
  where start > end currently).

* selser tests now @ 760 (vs 770 for wt2wt).  I suspect the rest
  are either tsr/dsr bugs or bugs while recording unmodified source
  chunks. (Requires the dependent gerrit patch 37608).

Change-Id: I7d4c18fe52b82688f5c33f3f63d8da393c8c0af2
---
M js/lib/mediawiki.SelectiveSerializer.js
M js/lib/mediawiki.WikitextSerializer.js
2 files changed, 111 insertions(+), 92 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/37609
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d4c18fe52b82688f5c33f3f63d8da393c8c0af2
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: MarkTraceur <[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