Subramanya Sastry has uploaded a new change for review.

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

Change subject: [roundtrip-test] Replace isolated "\r" chars with "\n" in 
source wt.
......................................................................

[roundtrip-test] Replace isolated "\r" chars with "\n" in source wt.

Not sure what is going on here, but when wikitext source is
posted to the server for parsing, the "\r" is getting lost which
screws up the DSR offsets wrt the original saved wikitext in the
rt-test script. This then seems to be causing useless diffs in
selser testing. Now not sure why the "\r" is not getting lost
second time around when it is used by selser.

But, just for now, I am hacking it by replacing stray "\r"
chars in wikitext source with "\n" before sending it along.

We are now back to zero errors with:

node roundtrip-test.js --prefix hewiki "ז'אן_ברוסול"

Change-Id: I3091a5c5a9f9aa156260e38f86144290b8deb3da
---
M tests/roundtrip-test.js
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/26/206126/1

diff --git a/tests/roundtrip-test.js b/tests/roundtrip-test.js
index 2e949f7..f06fe91 100755
--- a/tests/roundtrip-test.js
+++ b/tests/roundtrip-test.js
@@ -566,6 +566,14 @@
                var target = 
env.resolveTitle(env.normalizeTitle(env.page.name), '');
                return TemplateRequest.setPageSrcInfo(env, target, null);
        }).then(function() {
+               // WTF! But yes .. When wikitext is posted to the Parsoid 
server,
+               // looks like the "\r" characters are simply lost which then 
wreaks
+               // havoc further down the testing stream.
+               //
+               // So, replace them with "\n" beforehand. We have to separately
+               // investigate what is going on with the "\r" character either 
inside
+               // Parsoid or in node.js libs.
+               env.page.src = env.page.src.replace(/\r\n/g, 
'\n').replace(/\r/g, '\n');
                data.oldWt = env.page.src;
                // First, fetch the HTML for the requested page's wikitext
                var options = Object.assign({

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3091a5c5a9f9aa156260e38f86144290b8deb3da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

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

Reply via email to