URI encode name hash

This commit is contained in:
Nicolas Normand 2017-11-17 11:59:21 +01:00
parent 9d0a3d7d5e
commit fa8a7334ce
1 changed files with 6 additions and 5 deletions

View File

@ -3563,9 +3563,10 @@
var element;
// Ensure the named link is a valid HTML ID attribute
if( /^[a-zA-Z][\w:.-]*$/.test( name ) ) {
// Find the slide with the specified ID
element = document.getElementById( name );
try {
element = document.getElementById( decodeURIComponent( name ) );
}
catch (e) {
}
if( element ) {
@ -3614,7 +3615,7 @@
// Attempt to create a named link based on the slide's ID
var id = currentSlide.getAttribute( '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