Skip to content

Commit

Permalink
fix: remove deprecated xlink usages (antfu-collective#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd authored and StarHeartHunt committed Jul 20, 2024
1 parent b422f3d commit b4770be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/processing/svg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BadgePreset, Sponsor, SponsorkitRenderOptions, Sponsorship } from '../types'

export function genSvgImage(x: number, y: number, size: number, url: string) {
return `<image x="${x}" y="${y}" width="${size}" height="${size}" xlink:href="${url}"/>`
return `<image x="${x}" y="${y}" width="${size}" height="${size}" href="${url}"/>`
}

export function generateBadge(
Expand Down Expand Up @@ -29,7 +29,7 @@ export function generateBadge(
: sponsor.avatarUrlHighRes
) || sponsor.avatarUrl

return `<a ${url ? `xlink:href="${url}" ` : ''}class="${preset.classes || 'sponsorkit-link'}" target="_blank" id="${login}">
return `<a ${url ? `href="${url}" ` : ''}class="${preset.classes || 'sponsorkit-link'}" target="_blank" id="${login}">
${preset.name
? `<text x="${x + size / 2}" y="${y + size + 18}" text-anchor="middle" class="${preset.name.classes || 'sponsorkit-name'}" fill="${preset.name.color || 'currentColor'}">${encodeHtmlEntities(name)}</text>
`
Expand Down Expand Up @@ -88,7 +88,7 @@ export class SvgComposer {
}

generateSvg() {
return `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${this.config.width} ${this.height}" width="${this.config.width}" height="${this.height}">
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${this.config.width} ${this.height}" width="${this.config.width}" height="${this.height}">
<!-- Generated by https://github.com/antfu/sponsorskit -->
<style>${this.config.svgInlineCSS}</style>
${this.body}
Expand Down

0 comments on commit b4770be

Please sign in to comment.