swilliams/jq-wysihat — pull request #13 by carlocapocasa (2012-05-16 10:15:09+00:00)
Title: Bug fix for getRange function 

The _getNode_ method of the _Range_ object iterates over the range ancestor's child nodes with $.each. The $.each callback function checks if the currently iterating child is in range, and assigns it to a variable _child_ if it is.

There is a variable _child_ declared in the callback function's parent scope, but it never gets assigned anything by because the callback function argument is also called _child_.

The callback function now assigns to a variable called _node_, so now getRange works as intended.

Additionally, iteration is now stopped after finding a matching node.