Catrope has uploaded a new change for review.

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


Change subject: When we say originalHtml, we better mean it
......................................................................

When we say originalHtml, we better mean it

Gabriel noticed whitespace diffs in the problem reports. These were
caused by browsers' .innerHTML being broken on pre's. We compensate
for this in the converter, but not when generating originalHtml.

However, a variable called originalHtml really shouldn't be generated,
it should just literally be the original, unprocessed HTML. This
does mean it includes the doctype, <html> and <head> which aren't
included in editedHtml (that one's just the contents of the <body>), but
that's much easier to deal with on Parsoid's end than random newline
diffs all over the place.

Change-Id: I8e66cb79887f49f84114ab6b4d0e0d24aea744b6
---
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
M modules/ve/init/mw/ve.init.mw.Target.js
2 files changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index 21dc153..3409abe 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -668,8 +668,6 @@
 ve.init.mw.ViewPageTarget.prototype.setUpSurface = function ( doc ) {
        var $contentText = $( '#mw-content-text' );
 
-       // Store the HTML for reporting purposes
-       this.originalHtml = doc.body.innerHTML; // TODO store entire document 
in the future
        // Initialize surface
        this.surface = new ve.Surface( this, doc, this.surfaceOptions );
        this.surface.getContext().hide();
diff --git a/modules/ve/init/mw/ve.init.mw.Target.js 
b/modules/ve/init/mw/ve.init.mw.Target.js
index 799a382..5a13752 100644
--- a/modules/ve/init/mw/ve.init.mw.Target.js
+++ b/modules/ve/init/mw/ve.init.mw.Target.js
@@ -134,6 +134,7 @@
                        this, null, 'No HTML content in response from server', 
null
                );
        } else {
+               this.originalHtml = html;
                // 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)/ ) 
) {

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

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

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

Reply via email to