File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
extensions/notebook-renderers/src Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function formatStackTrace(stack: string) {
31
31
32
32
const formatSequence = / \u001b \[ .+ ?m / g;
33
33
const fileRegex = / F i l e \s + (?: \u001b \[ .+ ?m ) ? ( .+ ) : ( \d + ) / ;
34
- const lineNumberRegex = / ( (?: \u001b \[ .+ ?m ) ? [ - > ] * ?) ( \d + ) ( .* ) / ;
34
+ const lineNumberRegex = / ^ ( (?: \u001b \[ .+ ?m ) ? [ \ -> ] + ?) ( \d + ) (?: \u001b \[ 0 m ) ? ( .* ) / ;
35
35
const cellRegex = / (?< prefix > C e l l \s + (?: \u001b \[ .+ ?m ) ? I n \s * \[ (?< executionCount > \d + ) \] , \s * ) (?< lineLabel > l i n e (?< lineNumber > \d + ) ) .* / ;
36
36
// older versions of IPython ~8.3.0
37
37
const inputRegex = / (?< prefix > I n p u t \s + ?(?: \u001b \[ .+ ?m ) (?< cellLabel > I n \s * \[ (?< executionCount > \d + ) \] ) ) (?< postfix > .* ) / ;
@@ -41,7 +41,7 @@ function isIpythonStackTrace(stack: string) {
41
41
}
42
42
43
43
function stripFormatting ( text : string ) {
44
- return text . replace ( formatSequence , '' ) ;
44
+ return text . replace ( formatSequence , '' ) . trim ( ) ;
45
45
}
46
46
47
47
type cellLocation = { kind : 'cell' ; path : string } ;
You can’t perform that action at this time.
0 commit comments