Cscott has uploaded a new change for review.

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


Change subject: Fix attribute-dropped warning; suppress for parserTests.
......................................................................

Fix attribute-dropped warning; suppress for parserTests.

Change-Id: I2a585a9f882aaf845b11f96bf30def03c2739414
---
M js/lib/html5/treebuilder.js
1 file changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/js/lib/html5/treebuilder.js b/js/lib/html5/treebuilder.js
index e09e76f..cb72165 100644
--- a/js/lib/html5/treebuilder.js
+++ b/js/lib/html5/treebuilder.js
@@ -22,8 +22,8 @@
                        at.namespace = attribute.namespace;
                }
        } else {
+               var name, value, namespace;
                try {
-                       var name, value, namespace;
                        if ('namespaceURI' in attribute) { // DOM 4
                                name = attribute.name;
                                value = attribute.value;
@@ -39,7 +39,13 @@
                                element.setAttribute(name, value);
                        }
                } catch(e) {
-                       console.log("Can't set attribute '" + attribute.name + 
"' to value '" + attribute.value + "': (" + e + ')');
+                       // <br title/ > is part of a parserTest; we do the right
+                       // thing in that case (that is, we ignore the bogus
+                       // attribute, which is correct for wt2html at least).
+                       // Warn on console for all other cases, though.
+                       if (name !== 'title/') {
+                               console.warn("Can't set attribute '" + name + 
"' to value '" + value + "': (" + e + ')');
+                       }
                }
        }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a585a9f882aaf845b11f96bf30def03c2739414
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <wikime...@cscott.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to