-
-
Save arlolra/dd72acee363eefa10997 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/mediawiki.DOMUtils.js b/lib/mediawiki.DOMUtils.js | |
index e4ab596..8579169 100644 | |
--- a/lib/mediawiki.DOMUtils.js | |
+++ b/lib/mediawiki.DOMUtils.js | |
@@ -694,11 +694,22 @@ DOMUtils = DU = { | |
return this.isList(n) || this.isListItem(n); | |
}, | |
+ isNestedInListItem: function( n ) { | |
+ var parentNode = n.parentNode; | |
+ while ( parentNode ) { | |
+ if ( this.isListItem( parentNode ) ) { | |
+ return true; | |
+ } | |
+ parentNode = parentNode.parentNode; | |
+ } | |
+ return false; | |
+ }, | |
+ | |
isNestedListOrListItem: function(n) { | |
- return (this.isList(n) && this.isListItem(n.parentNode)) || | |
+ return (this.isList(n) && this.isNestedInListItem(n)) || | |
// so, n.parentNode.parentNode is guaranteed to exist | |
// will be <body> for top-level lists | |
- (this.isListItem(n) && this.isListItem(n.parentNode.parentNode)); | |
+ (this.isListItem(n) && this.isNestedInListItem(n)); | |
}, | |
isGeneratedFigure: function(n) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment