Skip to content

Commit 880b22f

Browse files
author
hartsantler
committed
fixed escape "<", ">" in strings for python to visjs
1 parent 972ec2a commit 880b22f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pythonjs/python_to_visjs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def visit_Pass(self, node):
276276
return 'pass'
277277

278278
def visit_Str(self, node):
279-
return '`%s`' %node.s.replace('"','&quot;').replace('\n', '\\n')
279+
return '`%s`' %node.s.replace('"','&quot;').replace('\n', '\\n').replace('&', '&amp;').replace('<','&lt;').replace('>','&gt;')
280280

281281
def visit_Name(self, node):
282282
return node.id

0 commit comments

Comments
 (0)