1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Remove the special handling for nameddests that look like standard pageNumbers

PR 7341 added special handling for `nameddest`s that look like pageNumbers, to prevent issues since we previously *incorrectly* supported specifying a pageNumber directly in the hash; i.e. `#10` versus the correct `#page=10` format.

Since this behaviour wasn't correct, PR 7757 fixed and deprecated the old format, which means that we no longer need to maintain the `nameddest` hack in multiple files.
This commit is contained in:
Jonas Jenwald 2017-05-16 20:35:44 +02:00
parent 8d2ae20fdd
commit 0ddf52aca5
4 changed files with 13 additions and 27 deletions

View file

@ -503,9 +503,8 @@ describe('annotation', function() {
var data = annotation.data;
expect(data.annotationType).toEqual(AnnotationType.LINK);
expect(data.url).toEqual('http://www.example.com/test.pdf#nameddest=15');
expect(data.unsafeUrl).toEqual(
'http://www.example.com/test.pdf#nameddest=15');
expect(data.url).toEqual('http://www.example.com/test.pdf#15');
expect(data.unsafeUrl).toEqual('http://www.example.com/test.pdf#15');
expect(data.dest).toBeUndefined();
expect(data.newWindow).toBeFalsy();
});

View file

@ -944,16 +944,16 @@ describe('api', function() {
expect(defaultAnnotations[0].url).toBeUndefined();
expect(defaultAnnotations[0].unsafeUrl).toEqual(
'../../0021/002156/215675E.pdf#nameddest=15');
'../../0021/002156/215675E.pdf#15');
expect(docBaseUrlAnnotations[0].url).toEqual(
'http://www.example.com/0021/002156/215675E.pdf#nameddest=15');
'http://www.example.com/0021/002156/215675E.pdf#15');
expect(docBaseUrlAnnotations[0].unsafeUrl).toEqual(
'../../0021/002156/215675E.pdf#nameddest=15');
'../../0021/002156/215675E.pdf#15');
expect(invalidDocBaseUrlAnnotations[0].url).toBeUndefined();
expect(invalidDocBaseUrlAnnotations[0].unsafeUrl).toEqual(
'../../0021/002156/215675E.pdf#nameddest=15');
'../../0021/002156/215675E.pdf#15');
Promise.all([
defaultLoadingTask.destroy(),