Fixed a bug that appears on preview when a .js file has a 2 or less name length
This commit is contained in:
parent
11511a89e3
commit
0edaa5f555
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ export const getAllScriptOffsets = (htmlFile) => {
|
||||||
if (ind === -1) {
|
if (ind === -1) {
|
||||||
foundJSScript = false;
|
foundJSScript = false;
|
||||||
} else {
|
} else {
|
||||||
endFilenameInd = htmlFile.indexOf('.js', ind + startTag.length + 3);
|
endFilenameInd = htmlFile.indexOf('.js', ind + startTag.length + 1);
|
||||||
filename = htmlFile.substring(ind + startTag.length, endFilenameInd);
|
filename = htmlFile.substring(ind + startTag.length, endFilenameInd);
|
||||||
lineOffset = htmlFile.substring(0, ind).split('\n').length + hijackConsoleErrorsScriptLength;
|
lineOffset = htmlFile.substring(0, ind).split('\n').length + hijackConsoleErrorsScriptLength;
|
||||||
offs.push([lineOffset, filename]);
|
offs.push([lineOffset, filename]);
|
||||||
|
|
Loading…
Reference in a new issue