mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Merge "Follow-up I64a8ed73: Fix NWE getWikitextFragment"
This commit is contained in:
commit
3c443724e2
|
@ -277,7 +277,8 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.restoreEditSection = function
|
|||
ve.init.mw.DesktopWikitextArticleTarget.prototype.getWikitextFragment = function ( doc, useRevision ) {
|
||||
var promise, xhr,
|
||||
params = {
|
||||
action: 'visualeditor',
|
||||
action: 'visualeditoredit',
|
||||
token: this.editToken,
|
||||
paction: 'serialize',
|
||||
html: ve.dm.converter.getDomFromModel( doc ).body.innerHTML,
|
||||
page: this.pageName
|
||||
|
@ -294,10 +295,10 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.getWikitextFragment = function
|
|||
);
|
||||
|
||||
promise = xhr.then( function ( response ) {
|
||||
if ( response.visualeditor ) {
|
||||
return response.visualeditor.content;
|
||||
if ( response.visualeditoredit ) {
|
||||
return response.visualeditoredit.content;
|
||||
}
|
||||
return $.Deferred.reject();
|
||||
return $.Deferred().reject();
|
||||
} );
|
||||
|
||||
promise.abort = function () {
|
||||
|
|
Loading…
Reference in a new issue