X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a9a011ed1f1daec47a9bc306f13ff91a63954e42..8dedd02357a95a0ae2c7961c8f1d0896b6311b3b:/services/workbench2/src/components/code-snippet/virtual-code-snippet.tsx

diff --git a/services/workbench2/src/components/code-snippet/virtual-code-snippet.tsx b/services/workbench2/src/components/code-snippet/virtual-code-snippet.tsx
index bc43d5d9f2..09db2c0426 100644
--- a/services/workbench2/src/components/code-snippet/virtual-code-snippet.tsx
+++ b/services/workbench2/src/components/code-snippet/virtual-code-snippet.tsx
@@ -32,7 +32,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 export interface CodeSnippetDataProps {
     lines: string[];
-    lineTransformer?: (line: string) => string;
+    lineFormatter?: (lines: string[], index: number) => string;
     className?: string;
     apiResponse?: boolean;
     linked?: boolean;
@@ -49,10 +49,11 @@ const mapStateToProps = (state: RootState): CodeSnippetAuthProps => ({
 });
 
 export const VirtualCodeSnippet = withStyles(styles)(connect(mapStateToProps)(
-    ({ classes, lines, linked, className, apiResponse, dispatch, auth }: CodeSnippetProps & CodeSnippetAuthProps & DispatchProp) => {
-        const RenderRow = ({index, style}) => (
-            <span style={style}>{linked ? renderLinks(auth, dispatch)(lines[index]) : lines[index]}</span>
-        );
+    ({ classes, lines, lineFormatter, linked, className, apiResponse, dispatch, auth }: CodeSnippetProps & CodeSnippetAuthProps & DispatchProp) => {
+        const RenderRow = ({index, style}) => {
+            const lineContents = lineFormatter ? lineFormatter(lines, index) : lines[index];
+            return <span style={style}>{linked ? renderLinks(auth, dispatch)(lineContents) : lineContents}</span>
+        };
 
         return <Typography
             component="div"
