diff --git a/package.json b/package.json
index 3572d88..b328852 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"dependencies": {
"@types/styled-components": "^5.1.10",
"axios": "^0.21.1",
+ "escape-html": "^1.0.3",
"framer-motion": "^4.1.17",
"image-to-base64": "^2.2.0",
"next": "11.0.0",
diff --git a/src/renderCard.tsx b/src/renderCard.tsx
index c906cd9..83e83fd 100644
--- a/src/renderCard.tsx
+++ b/src/renderCard.tsx
@@ -6,6 +6,8 @@ import * as LanyardTypes from "./LanyardTypes";
import { encodeBase64 } from "./toBase64";
import { blue, green, gray, gold, red } from "./defaultAvatars"
+let escape = require('escape-html');
+
type Parameters = {
theme?: string;
bg?: string;
@@ -153,16 +155,12 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
font-size: 1.15rem;
margin: 0 5px 0 0;
">
- ${body.data.discord_user.username}${discrim !== "hide"
- ? `#${body.data.discord_user.discriminator
- }`
- : ""
- }
+ ${escape(body.data.discord_user.username)}${discrim !== "hide" ?
+ `#${body.data.discord_user.discriminator}`
+ : "" }
- ${flags
- .map(
- v => `
+ ${flags.map(v => `
`
- )
- .join("")}
+ " />`).join("")}
- ${userStatus.length > 0 && hideStatus !== "true"
- ? `
+ ${userStatus.length > 0 && hideStatus !== "true" ? `
- `
- : `
-
- `
- }
- ${activity.assets && activity.assets.small_image
- ? `
-
`
- : ``
- }
+ "/>` : ``
+ }
PLAYING A GAME...
+PLAYING A GAME...
${activity.name}
- ${activity.details - ? ` + ${activity.details ? `${activity.details}
` - : `` - } + ">${activity.details}` : `` + }LISTENING NOW...
+LISTENING TO SPOTIFY...
${body.data.spotify.song.replace(/\&/g, "and")}
+ ">${escape(body.data.spotify.song)} + ">By ${escape(body.data.spotify.artist)}