From 4887780b67fb2903a79b223ce422ccd583c4294f Mon Sep 17 00:00:00 2001 From: Sanjay Ghemawat Date: Tue, 8 Aug 2023 15:35:45 -0700 Subject: [PATCH] Prefix sample type menu entry ids with "sampletype-". (#792) Previously, we would use the sample type name as the HTML id for the corresponding menu entry. However some profiles contain sample type names that conflict with other HTML ids we use (in particular, the sample type name "sample" conflicted with a different id). Remove this name clash by prefixing every menu entry with "sampletype-". some profiles caused the Javascript to break bec --- internal/driver/html/common.js | 6 +++--- internal/driver/html/header.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/driver/html/common.js b/internal/driver/html/common.js index d3312215..ff980f66 100644 --- a/internal/driver/html/common.js +++ b/internal/driver/html/common.js @@ -563,11 +563,11 @@ function viewer(baseUrl, nodes, options) { return str.replace(/([\\\.?+*\[\](){}|^$])/g, '\\$1'); } - function setSampleIndexLink(id) { - const elem = document.getElementById(id); + function setSampleIndexLink(si) { + const elem = document.getElementById('sampletype-' + si); if (elem != null) { setHrefParams(elem, function (params) { - params.set("si", id); + params.set("si", si); }); } } diff --git a/internal/driver/html/header.html b/internal/driver/html/header.html index 96ad4181..42cb7960 100644 --- a/internal/driver/html/header.html +++ b/internal/driver/html/header.html @@ -28,7 +28,7 @@

pprof