MCPcopy
hub / github.com/prometheus/prometheus / escapeHTML

Function escapeHTML

web/ui/mantine-ui/src/pages/query/uPlotChartHelpers.ts:83–96  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

81};
82
83const escapeHTML = (str: string): string => {
84 const entityMap: { [key: string]: string } = {
85 "&": "&",
86 "<": "&lt;",
87 ">": "&gt;",
88 '"': "&quot;",
89 "'": "&#39;",
90 "/": "&#x2F;",
91 };
92
93 return String(str).replace(/[&<>"'/]/g, function (s) {
94 return entityMap[s];
95 });
96};
97
98const formatLabels = (labels: { [key: string]: string }): string => `
99 <div class="labels">

Callers 2

formatLabelsFunction · 0.70
tooltipPluginFunction · 0.70

Calls 1

StringStruct · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…