react-client icon indicating copy to clipboard operation
react-client copied to clipboard

Internal Links in Slide Mode don't work

Open erhlee-bird opened this issue 5 years ago • 2 comments

Description

Slide Mode internal links don't seem to be working.

To Reproduce

In the Slide Mode example on the demo, there is an example of a link to another slide in the same deck.

https://demo.hedgedoc.org/p/slide-example#/17

image

Hovering over the link, the destination is "https://demo.hedgedoc.org/#/1/3".

Clicking on the link takes me to the "Intro" page rather than to the internal slide.

Expected behavior

Instead of being taken to the "Intro" page, I would expect to see the 3rd slide.

Logs

Config

Your Setup (please complete the following information):

  • Host OS: [e.g. Ubuntu 20.04]
  • NodeJS version [run node --version]
  • HedgeDoc version (Click "Version info" in the footer)
    • server [e.g. 2.0]
    • client [e.g. 2.0]

Additional context

Thanks for your work on this awesome project!

erhlee-bird avatar Jan 29 '21 22:01 erhlee-bird

Reveal.js uses the browser history push api to detect changes in the url like clicking on anchors. The problem is, that we define a base URL in the html head. This causes that the anchor (like #/1/3 links aren't treated as in-document jump links.

Proposed solution: I wouldn't remove the base url head tag, because it could break more stuff than it repairs. I would just won't fix it in 1.x, because this isn't critical. But I would move this issue to the frontend repository, so that we won't forget it when we reimplement reveal.js in 2.0.

A workaround is to adjust the links (e.g. in the slide demo content document). #/1/3 => p/NOTEID#/1/3

mrdrogdrog avatar Jan 29 '21 23:01 mrdrogdrog

@DerMolly @ErikMichelson @davidmehren any objection?

mrdrogdrog avatar Jan 29 '21 23:01 mrdrogdrog