Skip to content

Commit 16df64e

Browse files
vranayatbear
authored andcommitted
Replace d3.selection.html with .text. (#5840)
Its usage could lead to XSS and it's not compatible with Trusted Types.
1 parent e6a1d36 commit 16df64e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorboard/plugins/graph/tf_graph_common/contextmenu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function getMenu(sceneElement: TfGraphScene, menu: ContextMenuItem[]) {
8787
capture: true,
8888
});
8989
// Add provided items to the context menu.
90-
menuSelection.html('');
90+
menuSelection.text('');
9191
let list = menuSelection.append('ul');
9292
list
9393
.selectAll('li')
@@ -98,7 +98,7 @@ export function getMenu(sceneElement: TfGraphScene, menu: ContextMenuItem[]) {
9898
d.action(this, data, index);
9999
maybeCloseMenu();
100100
})
101-
.html(function (d) {
101+
.text(function (d) {
102102
return d.title(data);
103103
});
104104
};

0 commit comments

Comments
 (0)