Skip to content

Commit 73b139c

Browse files
committed
trim empty spaces before and after stack
1 parent b7dea2c commit 73b139c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

netstack.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141

142142
netStack.prototype.init = function() {
143143
// Get the stacktrace, sanitize it, and split it into lines
144-
var stacktrace = this.element.textContent,
144+
var stacktrace = this.element.textContent.trim(), // trim empty spaces and lines before and after stacktrace
145145
sanitizedStack = stacktrace.replace(/</g, '&lt;').replace(/>/g, '&gt;'),
146146
lines = sanitizedStack.split('\n'),
147147
lang = '',
@@ -201,9 +201,6 @@
201201
var langContor = 0;
202202
}
203203

204-
// Trim empty lines
205-
lines = lines.filter(line => line.trim() !== '');
206-
207204
for (var i = 0; i < lines.length; ++i) {
208205
var li = lines[i],
209206
hli = new RegExp('(\\S*)' + selectedLanguage.at + ' .*\\)'),

0 commit comments

Comments
 (0)