• Robert Knight's avatar
    Check for context match before stopping search early · 0d193d1f
    Robert Knight authored
    To reduce the chances of mis-anchoring quotes, check for a context match
    before stopping early. This helps when the quote is a word or phrase
    that is common in the document and the position hint is wrong, which can
    occur if the quote selector was created when using a different PDF
    viewer or version of PDF.js, which exacts text differently.
    
    For quotes captured at the start or end of a page we expect a mismatch
    in the prefix and suffix respectively because quote selectors can currently
    capture parts of the surrounding pages / DOM in `describe`, but when
    anchoring we only search for matches in one page of text at a time.
    0d193d1f
pdf-test.js 20.8 KB