diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2018-03-22 11:56:50 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2018-03-22 11:56:50 +0100 |
commit | 4cb0d52c73554872c4ab99f44a08fb8b9a76aa46 (patch) | |
tree | 0cce00e94310d83f0cc2d1dbe08dff034f1625f0 /js | |
parent | ba0e432542fd5c6c9e4de561e9cb3196f80d2b65 (diff) | |
parent | fa8a7334ce2ea99a736dd5e72734b08fc01c6fdc (diff) | |
download | perl-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
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 11 |
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; |