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

Provide a Linkable URL to ID Heading #3505

Closed
mouse0270 opened this issue May 31, 2024 · 2 comments · Fixed by #3506
Closed

Provide a Linkable URL to ID Heading #3505

mouse0270 opened this issue May 31, 2024 · 2 comments · Fixed by #3506

Comments

@mouse0270
Copy link

Your idea:

So I am sorry for posting this as I am pretty sure this is a duplicate of issue #3272 however, the linked issues saying this is being resolved are closed #1923 and #3262

But I am trying to find a way to link to either a specific page or a specific heading within a shareable link. For example, using this Brew: Fallout TTRPG by The Arcane Arcade I thought it would be useful to be able to provide links to users such as

  • https://homebrewery.naturalcrit.com/share/5BLGepL_5gWo#p82
  • https://homebrewery.naturalcrit.com/share/5BLGepL_5gWo#WEAPON_MOD_PROP_POWERFUL

so that users can click these links from outside sources and go to that specific page or that specific ID. However, even though linking to #WEAPON_MOD_PROP_POWERFUL appears to work while the document is loaded, it does not work when the user clicks a url and comes to the brew. Instead, it just keeps the user on the first page.

My assumption is because when the page loads, the pages have not been loaded yet, so the browser does not know where to direct the user to as that heading does not exist.

My request is, would it be possible to link players to an ID from the URL after the Global Headings have been registered. So, after a page loads and all headings are registered you check the URL and if there is a #ID at the end of the URL, you jump to that Heading if it exists?

@5e-Cleric
Copy link
Member

actually, this is a duplicate of #2820 which is not possible at this time, we'd need to create a function to check the url for the specific id handler and then scroll the iframe that contains the document to the desired heading... Will take a look at this, but i can't promise anything at this time.

@5e-Cleric
Copy link
Member

Just pushed a PR that should enable this. Closing as duplicate, all further discussion will be held at #2820

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

Successfully merging a pull request may close this issue.

2 participants