In my experience, canDeserializeRange() returns false even when the dom hasn't changed. Looking at it in the debugger, it looks like an off-by-one error in this code in rangy-serializer.js:
var result = deserializeRegex.exec(serialized);
var checksum = result[3];
return !checksum || checksum === getElementChecksum(rootNode);
The deserializeRegex has 4 capturing parentheses, so the item we're interested in is result[4], not result[3]. result[3] includes the brackets, so the test 1234 === '{1234}' fails.
In my experience,
canDeserializeRange()
returns false even when the dom hasn't changed. Looking at it in the debugger, it looks like an off-by-one error in this code inrangy-serializer.js
:The deserializeRegex has 4 capturing parentheses, so the item we're interested in is
result[4]
, notresult[3]
.result[3]
includes the brackets, so the test1234 === '{1234}'
fails.