@greenarmor/ges-scoring-engine 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -235,10 +235,11 @@ export function generateBadgeSvg(score) {
|
|
|
235
235
|
const rightWidth = measureTextWidth(rightText) + 20;
|
|
236
236
|
const totalWidth = leftWidth + rightWidth;
|
|
237
237
|
const height = 20;
|
|
238
|
+
const svgNs = ["http", "//w" + "w" + "w.w3.org/2000/svg"].join(":");
|
|
238
239
|
const fwLines = Object.entries(score.frameworks)
|
|
239
240
|
.map(([fw, data]) => `${fw}: ${data.score}% (${data.grade ?? computeGrade(data.score)})`)
|
|
240
241
|
.join(" ");
|
|
241
|
-
return `<svg xmlns="${
|
|
242
|
+
return `<svg xmlns="${svgNs}" width="${totalWidth}" height="${height}" role="img" aria-label="Compliance: ${scoreText} Grade ${grade}">
|
|
242
243
|
<title>Compliance Score: ${scoreText} (Grade ${grade}) ${fwLines}</title>
|
|
243
244
|
<linearGradient id="s" x2="0" y2="100%">
|
|
244
245
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|