aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNicolas Normand <Nicolas.J.Normand+github@gmail.com>2017-11-17 11:59:21 +0100
committerNicolas Normand <Nicolas.J.Normand+github@gmail.com>2017-11-17 11:59:21 +0100
commitfa8a7334ce2ea99a736dd5e72734b08fc01c6fdc (patch)
tree9ff2955e0fd7b99d15e410268e727d36ab0eb4eb /js
parent9d0a3d7d5ef46f1841fdd4e8f0397b9c311f50b0 (diff)
downloadperl-software-in-gnu-guix-fa8a7334ce2ea99a736dd5e72734b08fc01c6fdc.tar
perl-software-in-gnu-guix-fa8a7334ce2ea99a736dd5e72734b08fc01c6fdc.tar.gz
URI encode name hash
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index d3ba03c..3747e15 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3563,10 +3563,11 @@
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 ) {
// 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
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