Sharpbin
@@ -74,7 +74,7 @@
{#if menuOpen}
(menuOpen = false)}
- >Recent Pastes
+ class="block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
+ on:click={() => (menuOpen = false)}>Recent Pastes
{#if $user}
{#if $user.roles.includes(1) || $user.roles.includes(255)}
(menuOpen = false)}
- >Reports
+ class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
+ on:click={() => (menuOpen = false)}>Reports
{/if}
(menuOpen = false)}
- >Profile
+ class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
+ on:click={() => (menuOpen = false)}>Profile
+ class="mt-1 w-full rounded bg-neutral-800 px-3 py-2 text-center text-neutral-100 transition-colors hover:bg-neutral-700"
+ >Logout
{:else}
(menuOpen = false)}
- >Login
+ class="mt-1 block w-full rounded bg-neutral-800 px-3 py-2 text-neutral-100 transition-colors hover:bg-neutral-700"
+ on:click={() => (menuOpen = false)}>Login
(menuOpen = false)}
- >Register
+ class="mt-1 block w-full rounded px-3 py-2 text-neutral-100 transition-colors hover:bg-neutral-700 {data
+ .options?.registration_enabled
+ ? ''
+ : 'cursor-not-allowed bg-neutral-900 text-neutral-500'}"
+ on:click={() => (menuOpen = false)}>Register
{/if}
diff --git a/SharpbinV3.Client/src/lib/consts.ts b/SharpbinV3.Client/src/lib/consts.ts
index 93663b1..3e96b44 100644
--- a/SharpbinV3.Client/src/lib/consts.ts
+++ b/SharpbinV3.Client/src/lib/consts.ts
@@ -163,36 +163,35 @@ export const roles = {
403: 'Banned'
};
-export const trustedDomains =
- [
- 'img.youtube.com',
- 'i.ytimg.com',
+export const trustedDomains = [
+ 'img.youtube.com',
+ 'i.ytimg.com',
- 'github.com',
- 'githubusercontent.com',
- 'avatars.githubusercontent.com',
- 'camo.githubusercontent.com',
- 'raw.githubusercontent.com',
- 'github.githubassets.com',
+ 'github.com',
+ 'githubusercontent.com',
+ 'avatars.githubusercontent.com',
+ 'camo.githubusercontent.com',
+ 'raw.githubusercontent.com',
+ 'github.githubassets.com',
- 'cdn.discordapp.com',
- 'media.discordapp.net',
+ 'cdn.discordapp.com',
+ 'media.discordapp.net',
- 'i.redd.it',
- 'v.redd.it',
- 'external-preview.redd.it',
- 'preview.redd.it',
+ 'i.redd.it',
+ 'v.redd.it',
+ 'external-preview.redd.it',
+ 'preview.redd.it',
- 'i.imgur.com',
- 'imgur.com',
+ 'i.imgur.com',
+ 'imgur.com',
- 'pbs.twimg.com',
- 'video.twimg.com',
- 'twitter.com',
- 'x.com',
+ 'pbs.twimg.com',
+ 'video.twimg.com',
+ 'twitter.com',
+ 'x.com',
- 'images.cloudflare.com',
- 'cloudflare-ipfs.com',
+ 'images.cloudflare.com',
+ 'cloudflare-ipfs.com',
- 'upload.wikimedia.org'
- ];
+ 'upload.wikimedia.org'
+];
diff --git a/SharpbinV3.Client/src/lib/utils/markdown.ts b/SharpbinV3.Client/src/lib/utils/markdown.ts
index 96ede0e..7a27ab1 100644
--- a/SharpbinV3.Client/src/lib/utils/markdown.ts
+++ b/SharpbinV3.Client/src/lib/utils/markdown.ts
@@ -10,7 +10,11 @@ const tagMap: Record
= {
IFRAME: 'iframe'
};
-export async function parseMarkdown(md: string, preventExternal: boolean = true, allowTrustedDomains: boolean = true): Promise {
+export async function parseMarkdown(
+ md: string,
+ preventExternal: boolean = true,
+ allowTrustedDomains: boolean = true
+): Promise {
const html = await marked.parse(md);
let dom: WindowLike & { document: Document };