• Robert Knight's avatar
    Make TextRange ignore text in comments and processing instructions · dd0af4d8
    Robert Knight authored
    `Node.textContent` has a quirk where it does not count text in comments
    or processing instructions when called on an `Element` but does return
    the comment / processing instruction data if called directly on a
    `Comment` or `ProcessingInstruction` node.
    
    To make conversion between `Range`s and `TextRange`s consistent in both
    directions we need to always ignore text in comments/processing
    instructions.
    dd0af4d8
text-range-test.js 10.4 KB