kopia lustrzana https://github.com/badgen/badgen
fix: correctly render undefined label
rodzic
2ca1ce4755
commit
fdfe99c051
|
@ -48,7 +48,7 @@ export function badgen ({
|
|||
const width = sbRectWidth + stRectWidth
|
||||
const xlink = icon ? ' xmlns:xlink="http://www.w3.org/1999/xlink"' : ''
|
||||
|
||||
label = label ? sanitize(label) : undefined
|
||||
label = label ? sanitize(label) : ''
|
||||
status = sanitize(status)
|
||||
color = sanitize(color)
|
||||
labelColor = sanitize(labelColor)
|
||||
|
|
|
@ -181,8 +181,8 @@ exports[`test/badgen.spec.js TAP generate badge with { status, icon } > snapshot
|
|||
<rect width="536" height="200" fill="url(#a)"/>
|
||||
</g>
|
||||
<g aria-hidden="true" fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110">
|
||||
<text x="172" y="148" textLength="0" fill="#000" opacity="0.25">undefined</text>
|
||||
<text x="162" y="138" textLength="0">undefined</text>
|
||||
<text x="172" y="148" textLength="0" fill="#000" opacity="0.25"></text>
|
||||
<text x="162" y="138" textLength="0"></text>
|
||||
<text x="267" y="148" textLength="224" fill="#000" opacity="0.25">icon</text>
|
||||
<text x="257" y="138" textLength="224">icon</text>
|
||||
</g>
|
||||
|
@ -204,8 +204,8 @@ exports[`test/badgen.spec.js TAP generate badge with { status, icon, iconWidth }
|
|||
<rect width="596" height="200" fill="url(#a)"/>
|
||||
</g>
|
||||
<g aria-hidden="true" fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110">
|
||||
<text x="232" y="148" textLength="0" fill="#000" opacity="0.25">undefined</text>
|
||||
<text x="222" y="138" textLength="0">undefined</text>
|
||||
<text x="232" y="148" textLength="0" fill="#000" opacity="0.25"></text>
|
||||
<text x="222" y="138" textLength="0"></text>
|
||||
<text x="327" y="148" textLength="224" fill="#000" opacity="0.25">icon</text>
|
||||
<text x="317" y="138" textLength="224">icon</text>
|
||||
</g>
|
||||
|
|
Ładowanie…
Reference in New Issue