Skip to content

Commit

Permalink
Merge pull request #81 from wmde/fix-infinite-loop-in-empty-attribution
Browse files Browse the repository at this point in the history
While trimming empty nodes of the template, check if current element is not empty
  • Loading branch information
AndrewKostka committed Aug 6, 2015
2 parents 8c86849 + 3463e5b commit 6e6764e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/WikiAssetPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ $.extend( WikiAssetPage.prototype, {
* @return {jQuery}
*/
_trimNodeList: function( $nodes ) {
if( $nodes.length === 0 ) {
return $nodes;
}
if( $.trim( $nodes.eq( 0 ).text() ) === '' ) {
$nodes = $nodes.not( $nodes.eq( 0 ) );
}
Expand Down

0 comments on commit 6e6764e

Please sign in to comment.