mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 02:38:40 +00:00
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:
parent
5a40d90573
commit
20a5aa48b7
|
@ -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 ) {
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue