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

Named internal links not understood outside reveal.js #2276

Open
lechten opened this issue Nov 10, 2018 · 3 comments
Open

Named internal links not understood outside reveal.js #2276

lechten opened this issue Nov 10, 2018 · 3 comments

Comments

@lechten
Copy link
Contributor

lechten commented Nov 10, 2018

Internal links work fine with reveal.js as documented.
However, the documention suggest to link with #/some-slide to a section with id #some-slide, which essentially results in broken links. (No fragment with the id /some-slide exists.)

Based on a quick test it seems to me that such links also work if I omit the slash. What is the rationale for including it?

@lechten
Copy link
Contributor Author

lechten commented Nov 17, 2018

To phrase this differently: Is there any reason why I should not use valid links when linking into reveal.js presentations?

My use case is as follows: I've got lots of internal links between different presentations and into presentations, and I'd like those links to be understandable by crawlers and search engines. Towards that end, the slash must not be used. Any suggestions or recommendations? In particular, readURL() removes # and / before looking up DOM elements, which ensure that links without slashes currently work. Are there any plans to change that behavior in the future so that links without slashes might not work any longer?

@lechten
Copy link
Contributor Author

lechten commented Nov 21, 2018

To continue my use case: If I just use valid links without leading slash when linking into presentations, the browser history does not work. PR #2282 fixes this.

@lechten
Copy link
Contributor Author

lechten commented Nov 28, 2018

In PR #2282, there is a problem with fragments that do not start with #/: In Firefox, on most slides with named ID links, the contents (including the progress bar) jump upwards before being displayed at their correct position, which is very distracting. Any ideas why this might happen? (This does not happen with Chromium.)

As an example, try moving back and forth between slides 3 and 4 of this presentation in Firefox.

[Dec. 6: Updated link to sample presentation.]

tarsius pushed a commit to emacsmirror/oer-reveal that referenced this issue Mar 23, 2019
For links into and within presentations, reveal.js understands named
links as documented there:
https://github.com/hakimel/reveal.js#internal-links

However, for a slide with named id “target” those links are of the
form “#/target”, which is an invalid fragment identifier.  Slashes are
allowed in URLs, but then they represent data.  I would prefer valid
links.  My attempt to fix this is documented in this issue (if you are
reading this, maybe you can help?):
hakimel/reveal.js#2276

As stated in that issue, when using valid URLs, I need to choose
between broken history functionality and jumping contents upon slide
transitions.  For the time being, I choose broken history
functionality, which I perceive to be the minor annoyance.
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

1 participant