|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
import TopBar from '../components/TopBar.svelte'
|
|
|
|
|
import Icon from '@iconify/svelte'
|
|
|
|
|
import CodeView from '../components/CodeView.svelte'
|
|
|
|
|
import { goto } from '$app/navigation'
|
|
|
|
|
import { goto } from '$app/navigation'
|
|
|
|
|
|
|
|
|
|
let decompressed: string
|
|
|
|
|
let htmlContent: string
|
|
|
|
@ -20,13 +20,12 @@
|
|
|
|
|
let isPlainText = false
|
|
|
|
|
|
|
|
|
|
onMount(async () => {
|
|
|
|
|
let lang = getLangFromUrl()
|
|
|
|
|
// Remove github flavored markdown, redundant with markdown
|
|
|
|
|
lang = lang === 'gflm' ? 'md' : lang
|
|
|
|
|
|
|
|
|
|
// extract the part in the url after the hash
|
|
|
|
|
const hash = window.location.hash.slice(1)
|
|
|
|
|
if (hash) {
|
|
|
|
|
let lang = getLangFromUrl()
|
|
|
|
|
// Remove github flavored markdown, redundant with markdown
|
|
|
|
|
lang = lang === 'gflm' ? 'md' : lang
|
|
|
|
|
// decompress the data
|
|
|
|
|
const { decompress } = await import('$lib/brotli')
|
|
|
|
|
decompressed = await decompress(hash)
|
|
|
|
@ -53,7 +52,7 @@
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Redirect to editor page
|
|
|
|
|
goto('/editor')
|
|
|
|
|
await goto('/editor')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|