URI encode name hash
This commit is contained in:
parent
9d0a3d7d5e
commit
fa8a7334ce
11
js/reveal.js
11
js/reveal.js
@ -3563,10 +3563,11 @@
|
|||||||
var element;
|
var element;
|
||||||
|
|
||||||
// Ensure the named link is a valid HTML ID attribute
|
// Ensure the named link is a valid HTML ID attribute
|
||||||
if( /^[a-zA-Z][\w:.-]*$/.test( name ) ) {
|
try {
|
||||||
// Find the slide with the specified ID
|
element = document.getElementById( decodeURIComponent( name ) );
|
||||||
element = document.getElementById( name );
|
}
|
||||||
}
|
catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
if( element ) {
|
if( element ) {
|
||||||
// Find the position of the named slide and navigate to it
|
// Find the position of the named slide and navigate to it
|
||||||
@ -3614,7 +3615,7 @@
|
|||||||
// Attempt to create a named link based on the slide's ID
|
// Attempt to create a named link based on the slide's ID
|
||||||
var id = currentSlide.getAttribute( 'id' );
|
var id = currentSlide.getAttribute( 'id' );
|
||||||
if( id ) {
|
if( id ) {
|
||||||
id = id.replace( /[^a-zA-Z0-9\-\_\:\.]/g, '' );
|
id = encodeURIComponent( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the current slide has an ID, use that as a named link
|
// If the current slide has an ID, use that as a named link
|
||||||
|
Loading…
Reference in New Issue
Block a user