File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -779,13 +779,13 @@ export async function endCellAndDisplayErrorsInCell(
779779}
780780
781781export function findErrorLocation ( traceback : string [ ] , cell : NotebookCell ) {
782- const cellRegex = / C e l l \s + (?: \u001b \[ . + ? m ) ? I n \s * \[ (?< executionCount > \d + ) \] , \s * l i n e (?< lineNumber > \d + ) .* / ;
782+ const cellRegex = / C e l l \s + I n \s * \[ (?< executionCount > \d + ) \] , \s * l i n e (?< lineNumber > \d + ) .* / ;
783783 // older versions of IPython ~8.3.0
784- const inputRegex =
785- / I n p u t \s + ?(?: \u001b \[ .+ ?m ) ? I n \s * \[ (?< executionCount > \d + ) \] [ ^ < ] * < c e l l l i n e : \s ? (?< lineNumber > \d + ) > .* / ;
784+ const inputRegex = / I n p u t \s + ?I n \s * \[ (?< executionCount > \d + ) \] [ ^ < ] * < c e l l l i n e : \s ? (?< lineNumber > \d + ) > .* / ;
786785 let lineNumber : number | undefined = undefined ;
787786 for ( const line of traceback ) {
788- const lineMatch = cellRegex . exec ( line ) ?? inputRegex . exec ( line ) ;
787+ const cleanLine = line . replace ( / (?: \u001b \[ .+ ?m ) / g, '' ) ;
788+ const lineMatch = cellRegex . exec ( cleanLine ) ?? inputRegex . exec ( cleanLine ) ;
789789 if ( lineMatch && lineMatch . groups ) {
790790 lineNumber = parseInt ( lineMatch . groups [ 'lineNumber' ] ) ;
791791 break ;
You can’t perform that action at this time.
0 commit comments