Skip to content

Commit 4c542b1

Browse files
committed
feat: support contest extension on cf worker
1 parent 2a17ae0 commit 4c542b1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/cloudflare-worker/demo/demo.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ <h1>LeetCode Stats Card</h1>
2626
<select id="extension">
2727
<option value="" selected>No Extension</option>
2828
<option value="activity">Activity</option>
29+
<option value="contest">Contest</option>
2930
</select>
3031
<div>
3132
<button onclick="preview()">Preview</button>

src/cloudflare-worker/sanitize.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
ActivityExtension,
33
AnimationExtension,
44
Config,
5+
ContestExtension,
56
FontExtension,
67
RemoteStyleExtension,
78
ThemeExtension,
@@ -69,6 +70,8 @@ export function sanitize(config: Record<string, string>): Config {
6970

7071
if (config.ext === "activity" || config.extension === "activity") {
7172
sanitized.extensions.push(ActivityExtension);
73+
} else if (config.ext === "contest" || config.extension === "contest") {
74+
sanitized.extensions.push(ContestExtension);
7275
}
7376

7477
if (config.border) {

0 commit comments

Comments
 (0)