jenkins-bot has submitted this change and it was merged.

Change subject: Tweaks to bugSplit.js
......................................................................


Tweaks to bugSplit.js

* Replace a few dir-name unfriendly chars.
* Add charset metas to diffs so they can be viewed in a browser.

Change-Id: I3832108b5a75104ee73deec6eafdccee2d178cc0
---
M js/tests/bugSplit.js
1 file changed, 9 insertions(+), 5 deletions(-)

Approvals:
  GWicke: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/js/tests/bugSplit.js b/js/tests/bugSplit.js
index 85e6e1a..db71c68 100755
--- a/js/tests/bugSplit.js
+++ b/js/tests/bugSplit.js
@@ -9,13 +9,13 @@
 
 function writeFiles ( bugfileName, data ) {
        var keys = Object.keys(data),
-               val, dirName;
+               val, title, dirName;
 
        // SSS: the 'wiki' field adds the 'wiki' string at the end
-       // which is unnecessary
-       dirName = "./" + (data.wiki || 'none').replace(/wiki$/, '') + "." +
-               (data.title || 'no-title') + "." +
-               (data.timestamp || ('now-' + JSON.stringify(new Date())));
+       // which is unnecessary.  The wiki prefix makes it clear where the
+       // page comes from and whether the dev. needs to use a translation tool
+       // for that bug report.
+       dirName = "./" + (data.wiki || 'none').replace(/wiki$/, '') + "." + 
bugfileName;
 
        // Create dir
        fs.mkdirSync(dirName, "0755");
@@ -28,6 +28,10 @@
 
                val = data[key];
 
+               // Make diff readable by adding a charset meta
+               if (fileName === 'diff') {
+                       val = "<html><head><meta charset='utf-8'></head><body>" 
+ val + "</body></html>";
+               }
                if (fileName === 'originalHtml') {
                        // Strip everything upto <body> and after </body> tag
                        val = val.replace(/^.*<body[^<>]*>|<\/body>.*$/g, '');

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

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

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

Reply via email to