Skip to content

Commit 4125f95

Browse files
committed
fix: fixed failing linkDest for file links in following format '#page=1&view=Fit'
1 parent a868c0a commit 4125f95

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6780,7 +6780,10 @@ def uri_to_dict(uri):
67806780
if ftab[1].startswith("page="):
67816781
self.kind = LINK_GOTOR
67826782
self.file_spec = ftab[0]
6783-
self.page = int(ftab[1][5:]) - 1
6783+
page_part = ftab[1][5:]
6784+
if "&" in page_part:
6785+
page_part = page_part.split("&")[0]
6786+
self.page = int(page_part) - 1
67846787
else:
67856788
self.is_uri = True
67866789
self.kind = LINK_LAUNCH

src_classic/helper-python.i

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,10 @@ class linkDest(object):
901901
if ftab[1].startswith("page="):
902902
self.kind = LINK_GOTOR
903903
self.fileSpec = ftab[0]
904-
self.page = int(ftab[1][5:]) - 1
904+
page_part = ftab[1][5:]
905+
if "&" in page_part:
906+
page_part = page_part.split("&")[0]
907+
self.page = int(page_part) - 1
905908
else:
906909
self.isUri = True
907910
self.kind = LINK_LAUNCH

0 commit comments

Comments
 (0)