more forgiving code highlight line number format, add Promise polyfill

This commit is contained in:
Hakim El Hattab 2019-03-14 13:05:01 +01:00
parent cfc2f9cf9c
commit 5301a9ea03
5 changed files with 10 additions and 9 deletions

2
lib/js/promise.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -97,8 +97,7 @@ c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});
}
} );
// lofi xbrowser Promise.resolve()
return { then: function( resolve ) { resolve(); }};
return Promise.resolve();
},
@ -139,10 +138,13 @@ c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});
linesToHighlight.split( ',' ).forEach( function( lineNumbers ) {
// Avoid failures becase of whitespace
lineNumbers = lineNumbers.replace( /\s/g, '' );
// Ensure that we looking at a valid slide number (1 or 1-2)
if( /^[\d-]+$/.test( lineNumbers ) ) {
lineNumbers = lineNumbers.split( '-' )
lineNumbers = lineNumbers.split( '-' );
var lineStart = lineNumbers[0];
var lineEnd = lineNumbers[1] || lineStart;

View File

@ -84,8 +84,7 @@ var RevealMath = window.RevealMath || (function(){
} );
// lofi xbrowser Promise.resolve()
return { then: function( resolve ) { resolve(); }};
return Promise.resolve();
}
}

View File

@ -168,8 +168,7 @@ var RevealNotes = (function() {
}
// lofi xbrowser Promise.resolve()
return { then: function( resolve ) { resolve(); }};
return Promise.resolve();
},

View File

@ -22,8 +22,7 @@ var RevealZoom = (function(){
}
} );
// lofi xbrowser Promise.resolve()
return { then: function( resolve ) { resolve(); }};
return Promise.resolve();
}
}