Skip to content

Commit

Permalink
fix detection of named links (closes hakimel#1655)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Aug 1, 2018
1 parent 2c5396b commit 249f013
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 249f013

Please sign in to comment.