We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd43c86 commit 5e9261bCopy full SHA for 5e9261b
lib/codeit.js
@@ -1284,13 +1284,13 @@ class CodeitElement extends HTMLElement {
1284
1285
// if start pos is bigger than codeit length,
1286
// set start pos to codeit length
1287
- if (startPos > (cd.textContent.length-1)) startPos = cd.textContent.length-1;
+ if (startPos > cd.textContent.length) startPos = cd.textContent.length-1;
1288
1289
if (endPos) {
1290
1291
// if end pos is bigger than codeit length,
1292
// set end pos to codeit length
1293
- if (endPos > (cd.textContent.length-1)) endPos = cd.textContent.length-1;
+ if (endPos > cd.textContent.length) endPos = cd.textContent.length-1;
1294
1295
// get caret node and offset
1296
c = getCaretNode(startPos, endPos);
0 commit comments