From 249f0139598b20d02263b81a76f1ff87f8e74225 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 1 Aug 2018 10:55:59 +0200 Subject: [PATCH] fix detection of named links (closes #1655) --- js/reveal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index eaa9d601..3c31b973 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3966,9 +3966,9 @@ var bits = hash.slice( 2 ).split( '/' ), name = hash.replace( /#|\//gi, '' ); - // If the first bit is invalid and there is a name we can - // assume that this is a named link - if( isNaN( parseInt( bits[0], 10 ) ) && name.length ) { + // If the first bit is not fully numeric and there is a name we + // can assume that this is a named link + if( !/^[0-9]*$/.test( bits[0] ) && name.length ) { var element; // Ensure the named link is a valid HTML ID attribute