Skip to content

Commit fbf217f

Browse files
authored
Merge pull request #185 from glennsarti/gh-180-backslash-node-graph
(GH-180) Display backslashes in node graph
2 parents 7f15b0f + 9d6ce2c commit fbf217f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/providers/previewNodeGraphProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export class PuppetNodeGraphContentProvider implements vscode.TextDocumentConten
7676
label = ""`
7777

7878
var graphContent = compileResult.dotContent;
79+
// vis.jz sees backslashes as escape characters, however they are not in the DOT language. Instead
80+
// we should escape any backslash coming from a valid DOT file in preparation to be rendered
81+
graphContent = graphContent.replace(/\\/g,"\\\\");
7982
graphContent = graphContent.replace(`label = "vscode"`,styling);
8083

8184
svgContent = viz(graphContent,"svg");

0 commit comments

Comments
 (0)