File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import {
5656 isJupyterPercentScript ,
5757 markdownFromJupyterPercentScript ,
5858} from "./jupyter/percent.ts" ;
59+ import { resolve } from "path" ;
5960
6061export interface SourceRange {
6162 lines : [ number , number ] ;
@@ -600,7 +601,9 @@ function buildSourceRanges(markdown: MappedString): Array<SourceRange> {
600601 const { originalString } = mapResult ;
601602 const lineColFunc = mappedIndexToLineCol ( originalString ) ;
602603 const lineCol = lineColFunc ( mapResult . index ) ;
603- const fileName = originalString . fileName ;
604+ const fileName = originalString . fileName
605+ ? resolve ( originalString . fileName ) // resolve to absolute path using cwd
606+ : undefined ;
604607 const sourceLineNum = lineCol . line ;
605608
606609 // Check if this line continues the current range
You can’t perform that action at this time.
0 commit comments