naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.03k stars 316 forks source link

Get external link and scroll to element #3506

Open 5e-Cleric opened 3 weeks ago

5e-Cleric commented 3 weeks ago

This does work, not sure it is perfect.

Instead of having to catch the exact time of load finish of the pages, the function waits 100ms before scrolling. for this instance, i think this is appropiate, and easier to deal with.

Tested this with 90+ page doc, works fine. Unsetting smooth scroll as it triggers lots of page loads.

Closes #2820 and duplicate #3505

to test, try any brew url + #id

5e-Cleric commented 3 weeks ago

Now also works with page ids

Could use a deployment.

dbolack-ab commented 2 weeks ago

How should this be tested?

5e-Cleric commented 2 weeks ago

How should this be tested?

Go ahead and open any brew and append the bookmark: https://homebrewery-pr-3506.herokuapp.com/share/a6RCXwaDS58i#p4

You should be able to do it with any brew, with any element or page with id, as they are previously generated. The function uses its own scrolling methods to go to the page of the element.