Raymond Hill
Raymond Hill
In Chromium, range.endContainer can be a non-text type of node, which then cause EFatMarker.normalizeOffset() to fail and return -1 as the normalized offset. Result: what should be a valid selection...
Will possibly improve accuracy of results.
Good idea from @emn178 to pre-compute the value which is used twice in subsequent computations: https://github.com/gorhill/yamd5.js/blob/master/yamd5.js#L152 Now I just wish he gave at least a polite mention that he did...