diff --git a/website/src/routes/packages/[scope]/[name]/[version]/+page.svelte b/website/src/routes/packages/[scope]/[name]/[version]/+page.svelte index 8db296c..fb43a5b 100644 --- a/website/src/routes/packages/[scope]/[name]/[version]/+page.svelte +++ b/website/src/routes/packages/[scope]/[name]/[version]/+page.svelte @@ -25,25 +25,9 @@ $: markdown = data.readme && DOMPurify.sanitize($md?.render(data.readme) ?? '', { - FORBID_ATTR: ['src'], - FORBID_TAGS: [ - 'script', - 'style', - 'img', - 'video', - 'audio', - 'iframe', - 'object', - 'embed', - 'canvas', - 'source' - ] + FORBID_TAGS: ['script', 'style', 'audio', 'iframe', 'object', 'embed', 'canvas'] }); - $: publishedAt = new Date( - (data.versions.find(([version]) => version === data.version)?.[1] ?? 0) * 1000 - ); - $: allDependencies = [ [data.dependencies, 'Dependencies'], [data.peerDependencies, 'Peer Dependencies'] @@ -84,7 +68,7 @@ goto(`/packages/${data.scope}/${data.name}/${event.target?.value}`); }} > - {#each data.versions as [version]} + {#each data.versions as version} {/each} @@ -94,7 +78,7 @@
Published at
- +
diff --git a/website/src/routes/packages/[scope]/[name]/[version]/+page.ts b/website/src/routes/packages/[scope]/[name]/[version]/+page.ts index 5693f19..4dab722 100644 --- a/website/src/routes/packages/[scope]/[name]/[version]/+page.ts +++ b/website/src/routes/packages/[scope]/[name]/[version]/+page.ts @@ -113,7 +113,10 @@ export const load: PageLoad = async ({ params, fetch }) => { scope: params.scope, name: params.name, version: parsed.version, - versions, + versions: versions.map(([version]) => version), + publishedAt: new Date( + (versions.find(([version]) => version === parsed.version)?.[1] ?? 0) * 1000 + ), authors: parsed.authors?.map(parseAuthor), description: parsed.description, license: parsed.license,