GWicke has uploaded a new change for review.

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

Change subject: Use underscores in titles sent to the RB / Parsoid API
......................................................................

Use underscores in titles sent to the RB / Parsoid API

We are starting to normalize titles to consistently use underscores, and will
soon start redirecting any non-canonical requests to their canonical
equivalent.

This patch makes OCG request titles with underscores instead of spaces.

Change-Id: I7dcd46f32d6534bfb8031f10c44d22dacc57a905
---
M lib/parsoid.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/bundler
 refs/changes/46/275746/1

diff --git a/lib/parsoid.js b/lib/parsoid.js
index 659e69c..d9bb13e 100644
--- a/lib/parsoid.js
+++ b/lib/parsoid.js
@@ -143,7 +143,8 @@
                } else {
                        apiURL = url.resolve(apiURL, './page/html/');
                }
-               apiURL += encodeURIComponent(title); /* Encode slashes. */
+        // Use underscores, escape delimiters incl. slashes.
+               apiURL += encodeURIComponent(title.replace(/ /g, '_'));
                if (revid) {
                        apiURL += '/' + revid;
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dcd46f32d6534bfb8031f10c44d22dacc57a905
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler
Gerrit-Branch: master
Gerrit-Owner: GWicke <gwi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to