aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-03-22 11:56:50 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-03-22 11:56:50 +0100
commit4cb0d52c73554872c4ab99f44a08fb8b9a76aa46 (patch)
tree0cce00e94310d83f0cc2d1dbe08dff034f1625f0
parentba0e432542fd5c6c9e4de561e9cb3196f80d2b65 (diff)
parentfa8a7334ce2ea99a736dd5e72734b08fc01c6fdc (diff)
downloadperl-software-in-gnu-guix-4cb0d52c73554872c4ab99f44a08fb8b9a76aa46.tar
perl-software-in-gnu-guix-4cb0d52c73554872c4ab99f44a08fb8b9a76aa46.tar.gz
Merge branch 'URI-encode-name-hash' of https://github.com/nnormand/reveal.js into dev
-rw-r--r--js/reveal.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 0e9fb28..fe4b432 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3776,10 +3776,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
@@ -3834,7 +3835,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 );
}
var indexf;