Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undocumented quirks in page range specification #40

Open
TSSlade opened this issue Feb 20, 2023 · 1 comment
Open

undocumented quirks in page range specification #40

TSSlade opened this issue Feb 20, 2023 · 1 comment

Comments

@TSSlade
Copy link

TSSlade commented Feb 20, 2023

The following declaration will fail with the specified errors:

{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [[7, 8], 13]}
# PDF Parameters invalid: Unterminated string in JSON at position 80
{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [,[7, 8], 13]}
# PDF Parameters invalid: Unexpected token ',', ..." "page": [,[7, 8], 1"... is not valid JSON

However this one will work:
{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [ [7, 8], 13]}

The example of proper syntax for a multiple-page range gives [1, [3, 6], 8] but does not specify that the initial entry must be a single page rather than a range of pages.

@batman-nair
Copy link
Contributor

batman-nair commented Feb 28, 2023

Faced the same problem and found the issue in code. It is not related to starting with a single page or not.

The issue is double square brackets ("[[" and "]]") are sort of skipped in the JSON parsing as it is used for Obsidian linking. The solution is to add a space in between the double square brackets.

Documenting the behavior or fixing it would be beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants