Commit ed132877 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Replace deprecated method `String.prototype.substr`

`String.protoype.substr` is a deprecated method (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr). It is recommended to be replaced by `String.prototype.substring` method (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring).
parent f3cdd86d
......@@ -533,9 +533,8 @@ export async function anchor(root, selectors) {
const { index, offset, text } = await findPageByOffset(position.start);
const start = position.start - offset;
const end = position.end - offset;
const length = end - start;
const matchedText = text.substr(start, length);
const matchedText = text.substring(start, end);
if (quote.exact !== matchedText) {
throw new Error('quote mismatch');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment