About
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index 2299763..3c0f539 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -34,3 +34,6 @@ export function getLangFromUrl() {
export const byId = (id: string) => document.getElementById(id)
+export function isInIframe(): boolean {
+ return window !== window.parent
+}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index c47734e..b408e75 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -8,9 +8,10 @@
import rehypeStringify from 'rehype-stringify'
import hljs from 'highlight.js'
import 'highlight.js/styles/nord.min.css'
+ import { getLangFromUrl, isInIframe } from '$lib/utils'
import TopBar from '../components/TopBar.svelte'
import Icon from '@iconify/svelte'
- import { getLangFromUrl } from '$lib/utils'
+ import CodeView from '../components/CodeView.svelte'
let decompressed: string
let htmlContent: string
@@ -61,30 +62,46 @@
-
-
-
-
-
+ {#if !isInIframe()}
+
+
+
+
+
+ {/if}
+
{#if htmlContent || decompressed}
-
- {#if isMarkdown}
- {@html htmlContent}
- {:else if isPlainText}
-
- {decompressed}
-
- {:else}
-
{@html htmlContent}
- {/if}
-
+ {#if isInIframe()}
+
+ {:else}
+
+ {/if}
{/if}
+
+