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

Fix direct chapter links for searches containing text highlights #27

Open
cblanken opened this issue Jun 5, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@cblanken
Copy link
Owner

cblanken commented Jun 5, 2024

With the current link creation, some generated links are invalid because they surround a <span> tag or parts of it get included in the URL.

For example
image

Uses this link https://wanderinginn.com/2017/06/21/2-31/#:~:text=%E2%80%9CMagnolia%2C%20please%2C%20Erin.%20%3Cspan which doesn't properly link to the text fragment since it should only include the text from the source page.

@cblanken cblanken added the bug Something isn't working label Jun 5, 2024
@cblanken cblanken self-assigned this Jun 5, 2024
@cblanken
Copy link
Owner Author

cblanken commented Oct 29, 2024

It should be safe to pass the TextRef text through a BeautifulSoup parser and grab the text.

If the parse fails then the the text can be iteratively reduced until a valid chunk is found for the link or simply default to the chapter link without the fragment cruft if a valid parse can't be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant