• Robert Knight's avatar
    Add missing page index bounds check · a2336a7c
    Robert Knight authored
    When anchoring an annotation with a position and a quote selector, if
    the position selector fails, then PDF anchoring searches page contents
    starting with those pages nearest the position.
    
    If the position selector's `start` offset was greater than the length of
    the PDF's text, `prioritizePages` would try to fetch the text of page
    indexes beyond the valid range, causing PDF.js to throw an exception and
    quote anchoring to fail.
    
    Fix this by adding a missing bounds check.
    
    This is a partial fix for #558. It fixes anchoring of one of two test
    annotations on that page. The other fails due to differences in the
    extracted text between the HTML and PDF versions of the article.
    a2336a7c
Name
Last commit
Last update
..
anchoring Loading commit data...
config Loading commit data...
highlighter Loading commit data...
plugin Loading commit data...
test Loading commit data...
util Loading commit data...
vendor Loading commit data...
.eslintrc.js Loading commit data...
adder.html Loading commit data...
adder.js Loading commit data...
annotation-counts.js Loading commit data...
annotation-sync.js Loading commit data...
delegator.coffee Loading commit data...
features.js Loading commit data...
frame-observer.js Loading commit data...
guest.coffee Loading commit data...
host.coffee Loading commit data...
main.js Loading commit data...
pdf-sidebar.coffee Loading commit data...
pdfjs-rendering-states.js Loading commit data...
plugin.coffee Loading commit data...
range-util.js Loading commit data...
selections.js Loading commit data...
sidebar-trigger.js Loading commit data...
sidebar.coffee Loading commit data...