Subramanya Sastry has uploaded a new change for review.

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


Change subject: Replace some more uses of dataParsoid and delete 
DOMUtils.dataParsoid
......................................................................

Replace some more uses of dataParsoid and delete DOMUtils.dataParsoid

* There were a couple more uses of dataParsoid left around in
  DOMUtils in parallel to getDataParsoid.  Fixed and deleted
  the dataParsoid function.

* No change in parser tests results.

Change-Id: Ia97b05e6b98a7f8ee17d8d137926f3a6fe0b2379
---
M js/lib/mediawiki.DOMUtils.js
1 file changed, 3 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/48/57648/1

diff --git a/js/lib/mediawiki.DOMUtils.js b/js/lib/mediawiki.DOMUtils.js
index efb3f7f..ed85e2a 100644
--- a/js/lib/mediawiki.DOMUtils.js
+++ b/js/lib/mediawiki.DOMUtils.js
@@ -57,12 +57,6 @@
                this.loadDataAttrib(node, 'parsoid', {});
        },
 
-
-       dataParsoid: function(n) {
-               var str = n.getAttribute("data-parsoid");
-               return str ? JSON.parse(str) : {};
-       },
-
        getDataParsoid: function ( n ) {
                if ( ! ( n.data && n.data.parsoid ) ) {
                        this.loadDataParsoid( n );
@@ -270,7 +264,7 @@
        },
 
        isLiteralHTMLNode: function(n) {
-               return this.hasLiteralHTMLMarker(this.dataParsoid(n));
+               return this.hasLiteralHTMLMarker(this.getDataParsoid(n));
        },
 
        isIndentPre: function(n) {
@@ -318,7 +312,7 @@
                }
 
                var next = node.nextSibling;
-               if (next && this.isElt(next) && this.dataParsoid(next).tsr) {
+               if (next && this.isElt(next) && this.getDataParsoid(next).tsr) {
                        // If node's sibling has a valid tsr, then the sibling
                        // is outside a template, and since node's start tag 
itself
                        // is inside a template, this automatically implies that
@@ -331,7 +325,7 @@
                for (var n = children.length, i = n-1; i >= 0; i--) {
                        var c = children[i];
                        if (this.isElt(c)) {
-                               return this.endTagOutsideTemplate(c, 
this.dataParsoid(c));
+                               return this.endTagOutsideTemplate(c, 
this.getDataParsoid(c));
                        }
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia97b05e6b98a7f8ee17d8d137926f3a6fe0b2379
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

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

Reply via email to