readium/readium-cfi-js — pull request #9 by vilmosioo (2014-09-09 16:17:40+00:00)
Title: Small bug fix when calling generateElementRangeComponent

Avoid error being thrown when setting start/end of a range without specifying an offset.

Specifically, when generating a range CFI using full nodes, the epub library will throw an error because the native Range object's `setStart` and `setEnd` functions expect 2 arguments instead of just one.

Replaced this code with `setStartBefore` and `setEndAfter` to create a valid range encompassing these two nodes.