Esanders has uploaded a new change for review.

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


Change subject: Remove hack for old version of Parsoid
......................................................................

Remove hack for old version of Parsoid

Removing check for parsoid returning document fragments.

Change-Id: I5a8729d93907d13c699a1f3cf43ffd3e0c45b003
---
M modules/ve/init/mw/ve.init.mw.Target.js
1 file changed, 2 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/59/63159/1

diff --git a/modules/ve/init/mw/ve.init.mw.Target.js 
b/modules/ve/init/mw/ve.init.mw.Target.js
index 8a58e57..1793dcb 100644
--- a/modules/ve/init/mw/ve.init.mw.Target.js
+++ b/modules/ve/init/mw/ve.init.mw.Target.js
@@ -121,7 +121,7 @@
  * @emits loadError
  */
 ve.init.mw.Target.onLoad = function ( response ) {
-       var key, tmp, el, html,
+       var key, tmp, el,
                data = response ? response.visualeditor : null;
 
        if ( !data && !response.error ) {
@@ -139,14 +139,7 @@
                );
        } else {
                this.originalHtml = data.content;
-               // HACK for backwards compatibility with older versions of 
Parsoid, detect whether
-               // data.content is a document fragment or a full HTML document
-               if ( data.content.match( /^<(!doctype|html|head|body)(>|\s)/i ) 
) {
-                       html = data.content;
-               } else {
-                       html = '<!doctype html><html><head></head><body>' + 
data.content + '</body></html>';
-               }
-               this.doc = ve.createDocumentFromHTML( html );
+               this.doc = ve.createDocumentFromHTML( this.originalHtml );
 
                /* Don't show notices with no visible html (bug 43013). */
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a8729d93907d13c699a1f3cf43ffd3e0c45b003
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to