Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated String.prototype.substr() #254

Merged
merged 1 commit into from
Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/inlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ var parseLinkTitle = function() {
return null;
} else {
// chop off quotes from title and unescape:
return unescapeString(title.substr(1, title.length - 2));
return unescapeString(title.slice(1, -1));
}
};

Expand Down Expand Up @@ -567,11 +567,11 @@ var parseLinkDestination = function() {
if (openparens !== 0) {
return null;
}
res = this.subject.substr(savepos, this.pos - savepos);
res = this.subject.slice(savepos, this.pos);
return normalizeURI(unescapeString(res));
} else {
// chop off surrounding <..>:
return normalizeURI(unescapeString(res.substr(1, res.length - 2)));
return normalizeURI(unescapeString(res.slice(1, -1)));
}
};

Expand Down Expand Up @@ -856,7 +856,7 @@ var parseReference = function(s, refmap) {
if (matchChars === 0) {
return 0;
} else {
rawlabel = this.subject.substr(0, matchChars);
rawlabel = this.subject.slice(0, matchChars);
}

// colon:
Expand Down