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

Query strings break hash links on suttacentral #13

Open
benmneb opened this issue Sep 27, 2022 · 4 comments
Open

Query strings break hash links on suttacentral #13

benmneb opened this issue Sep 27, 2022 · 4 comments

Comments

@benmneb
Copy link
Owner

benmneb commented Sep 27, 2022

It appends ?ref=benmneb.github.io/pts-converter/ to the end of the ‘Read this sutta’ links, so I might look up S III 109 and it will form the following url (for English): https://suttacentral.net/sn22.84/en/sujato?layout=sidebyside&reference=main/pts&notes=asterisk&highlight=false&script=latin#pts-vp-pli3.109?ref=benmneb.github.io/pts-converter/

But that takes me to the start of SN 22.84

If I remove the ?ref=benmneb.github.io/pts-converter/ from the end of the url, then it scrolls to pts-vp-pli3.109 which is the behaviour that I was actually hoping for.

from https://discourse.suttacentral.net/t/suttacentral-2021-bug-reports-here/19609/215

@benmneb
Copy link
Owner Author

benmneb commented Sep 27, 2022

on second thought, i dont think this is me. i think its sutta central.

if you go directly to https://suttacentral.net/sn22.84/en/sujato?layout=sidebyside&reference=main/pts&notes=asterisk&highlight=false&script=latin#pts-vp-pli3.109 (or its short form https://suttacentral.net/sn22.84/en/sujato#pts-vp-pli3.109) it doenst even scroll to the correct place. but pressing enter in the URL bar after the page has already loaded does (which is why it seems like my params might be the problem).

im guessing because when the page loads, element with id pts-vp-pli3.109 doesnt exist yet. you can see the sutta content stagger in a bit after the header and footer load.

@thesunshade
Copy link

When I click on the first link, it scrolls to the correct place for me.

The second link will only work if your default setting is that the PTS ids are displayed.

In any case, is it allowable to have two ? in a url? I'd say it's better to not add params.

Also, I think Google can give them the referrer if they want to know. I also don't think Bhante ever looks at the analytics. 😁

@benmneb
Copy link
Owner Author

benmneb commented Sep 27, 2022

When I click on the first link, it scrolls to the correct place for me.

hmm true, safari iOS scrolls to to it, but firefox, chrome and safari on macOS dont for me. can you get it to work on desktop?

In any case, is it allowable to have two ? in a url? I'd say it's better to not add params.

i doubt it. your probably right

I also don't think Bhante ever looks at the analytics. 😁

🥲

@thesunshade
Copy link

can you get it to work on desktop?

I'm on Windows FF and it works.

But on chrome it does not. Huh. Strange. As you said, if you put the cursor in the url bar after the page has loaded and press enter, then it does scroll to the spot.

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