Browse Source
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
pull/853/head
Tobias Speicher
3 years ago
No known key found for this signature in database
GPG Key ID: 2CF824BD810C3BDB
2 changed files with
2 additions and
2 deletions
lib/rules_block/table.js
lib/rules_core/smartquotes.js
@ -9,7 +9,7 @@ function getLine(state, line) {
var pos = state . bMarks [ line ] + state . tShift [ line ] ,
var pos = state . bMarks [ line ] + state . tShift [ line ] ,
max = state . eMarks [ line ] ;
max = state . eMarks [ line ] ;
return state . src . substr ( pos , max - pos ) ;
return state . src . slice ( pos , max ) ;
}
}
function escapedSplit ( str ) {
function escapedSplit ( str ) {
@ -13,7 +13,7 @@ var APOSTROPHE = '\u2019'; /* ’ */
function replaceAt ( str , index , ch ) {
function replaceAt ( str , index , ch ) {
return str . substr ( 0 , index ) + ch + str . substr ( index + 1 ) ;
return str . slice ( 0 , index ) + ch + str . slice ( index + 1 ) ;
}
}
function process_inlines ( tokens , state ) {
function process_inlines ( tokens , state ) {