Update API for Parsoid prefix changes

The format for wiki prefixes in Parsoid has changed from /mw:Pagename to
/mw/Pagename . Update the API module and the config+docs for this
change. The default value of the prefix ('localhost') should still work
for stock localhost setups.

Change-Id: Ic6f3793d175106cc1fae17980d20add63c3f783f
This commit is contained in:
Catrope 2012-08-13 17:56:30 -07:00
parent 5a40d90573
commit 20a5aa48b7
2 changed files with 7 additions and 6 deletions

View file

@ -21,11 +21,10 @@ class ApiVisualEditor extends ApiBase {
if ( $params['paction'] === 'parse' ) {
if ( $page->exists() ) {
$parsed = Http::get(
// Insert slash since wgVisualEditorParsoidURL may or may not
// end in a slash. Double slashes are no problem --catrope
$parsoid . '/' . urlencode(
$wgVisualEditorParsoidPrefix . $page->getPrefixedDBkey()
)
// Insert slash since wgVisualEditorParsoidURL does not
// end in a slash
$parsoid . '/' . $wgVisualEditorParsoidPrefix . '/' .
urlencode( $page->getPrefixedDBkey() )
);
if ( $parsed ) {

View file

@ -11,9 +11,11 @@
/* Configuration */
// URL to the Parsoid instance
// MUST NOT end in a slash due to Parsoid bug
$wgVisualEditorParsoidURL = 'http://localhost:8000';
// Interwiki prefix to pass to the Parsoid instance
$wgVisualEditorParsoidPrefix = 'localhost:';
// Parsoid will be called as $url/$prefix/$pagename
$wgVisualEditorParsoidPrefix = 'localhost';
/* Setup */