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

invalid ID attribute and character stripping #1230

Closed
bartoleo opened this issue May 13, 2015 · 3 comments
Closed

invalid ID attribute and character stripping #1230

bartoleo opened this issue May 13, 2015 · 3 comments

Comments

@bartoleo
Copy link

I'm using a tool to create reveal.js slides from asciidoctor files.
Asciidoctor creates sections with id containing characters outside (a-z,A-Z,0-9,.,-,_,:), e.g.:
à è ì ò ù ...

readUrl functions checks id:

// Ensure the named link is a valid HTML ID attribute
            if( /^[a-zA-Z][\w:.-]*$/.test( name ) ) {

writeUrl strips charactees:

id = id.replace( /[^a-zA-Z0-9\-\_\:\.]/g, '' );

These sections are not linkable from url.

There's a reason for these 'checks'?
HTML5 is very permissive about id attribute:
http://www.w3.org/TR/html5/dom.html#the-id-attribute

@hakimel
Copy link
Owner

hakimel commented Jun 2, 2015

Would be great to make this more flexible than the current HTML 4 validation.

@Peque
Copy link

Peque commented Feb 14, 2018

Another consequence of this: if you execute grunt serve and modify the HTML file while displaying the slide with a "broken" ID in the browser (imagine a live preview of your presentation while editing it), it will automatically jump to the first slide, instead of displaying the same slide after the edit. Which means after each edit you will have to navigate again to that slide to see the changes.

@hakimel
Copy link
Owner

hakimel commented Mar 22, 2018

This was fixed in #2037. The fix is available from the dev branch until next release.

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

No branches or pull requests

4 participants