diff --git a/client/package-lock.json b/client/package-lock.json index b1e404b1..e566b6d9 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -16,7 +16,6 @@ "@codemirror/view": "^6.16.0", "@lezer/highlight": "^1.1.6", "codemirror": "^6.0.1", - "dompurify": "^3.1.3", "frappe-charts": "^1.6.2", "highlight-words": "^1.2.2", "marked": "^12.0.2", @@ -30,7 +29,6 @@ "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/dompurify": "^3.0.5", "@types/node": "^20.3.0", "@types/sortablejs": "^1.15.1", "@typescript-eslint/eslint-plugin": "^5.59.2", @@ -1439,15 +1437,6 @@ "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", "dev": true }, - "node_modules/@types/dompurify": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.0.5.tgz", - "integrity": "sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg==", - "dev": true, - "dependencies": { - "@types/trusted-types": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -1487,12 +1476,6 @@ "integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==", "dev": true }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "dev": true - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", @@ -2093,11 +2076,6 @@ "node": ">=6.0.0" } }, - "node_modules/dompurify": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.3.tgz", - "integrity": "sha512-5sOWYSNPaxz6o2MUPvtyxTTqR4D3L77pr5rUQoWgD5ROQtVIZQgJkXbo1DLlK3vj11YGw5+LnF4SYti4gZmwng==" - }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", diff --git a/client/package.json b/client/package.json index 5ef3582a..aac86455 100644 --- a/client/package.json +++ b/client/package.json @@ -15,7 +15,6 @@ "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/dompurify": "^3.0.5", "@types/node": "^20.3.0", "@types/sortablejs": "^1.15.1", "@typescript-eslint/eslint-plugin": "^5.59.2", @@ -43,7 +42,6 @@ "@codemirror/view": "^6.16.0", "@lezer/highlight": "^1.1.6", "codemirror": "^6.0.1", - "dompurify": "^3.1.3", "frappe-charts": "^1.6.2", "highlight-words": "^1.2.2", "marked": "^12.0.2", diff --git a/client/src/app.html b/client/src/app.html index 0f2ed7d8..e46c8602 100755 --- a/client/src/app.html +++ b/client/src/app.html @@ -24,8 +24,6 @@ rel="stylesheet" /> - pastemyst - %sveltekit.head% diff --git a/client/src/app.scss b/client/src/app.scss index dc35894f..be3ae3f9 100755 --- a/client/src/app.scss +++ b/client/src/app.scss @@ -329,3 +329,48 @@ section { margin-bottom: 0.25rem; } } + +.markdown { + text-align: justify; + line-height: 1.5rem; + font-size: $fs-normal; + + h1 { + margin-top: 0; + } + + h1:first-child { + margin-top: 1rem; + } + + h1, + h2, + h3 { + border-bottom: 1px solid var(--color-bg2); + padding-bottom: 0.5rem; + margin-top: 2rem; + } + + blockquote { + border-left: 4px solid var(--color-secondary); + padding-left: 1rem; + margin-left: 0; + } + + pre { + background-color: var(--color-bg1); + border-radius: $border-radius; + border: 1px solid var(--color-bg2); + line-height: initial; + padding: 1rem; + + code { + border: none; + background-color: initial; + } + } + + img { + max-width: 100%; + } +} diff --git a/client/src/lib/Markdown.svelte b/client/src/lib/Markdown.svelte index c9a2ed3a..73e1a8ef 100644 --- a/client/src/lib/Markdown.svelte +++ b/client/src/lib/Markdown.svelte @@ -1,5 +1,4 @@ - -{@html DOMPurify.sanitize(markdownHtml)} - - +
+ + {@html markdownHtml} +
diff --git a/client/src/routes/+layout.svelte b/client/src/routes/+layout.svelte index bcd5c50f..af6db681 100755 --- a/client/src/routes/+layout.svelte +++ b/client/src/routes/+layout.svelte @@ -5,7 +5,7 @@ import { activePastesStores, currentUserStore, versionStore } from "$lib/stores"; import CommandPalette from "$lib/CommandPalette.svelte"; import { Close, setBaseCommands, type Command } from "$lib/command"; - import { afterNavigate, beforeNavigate, goto } from "$app/navigation"; + import { beforeNavigate, goto } from "$app/navigation"; import ThemeContext from "$lib/ThemeContext.svelte"; import { env } from "$env/dynamic/public"; @@ -80,26 +80,18 @@ beforeNavigate(() => { setBaseCommands(getCommands()); }); - - let loaded = false; - - afterNavigate(() => { - loaded = true; - }); - {#if loaded} -
-
+
+
-
- -
+
+ +
-
-
- {/if} +
diff --git a/client/src/routes/[paste]/+page.svelte b/client/src/routes/[paste]/+page.svelte index 950e5f16..c2bfdf30 100755 --- a/client/src/routes/[paste]/+page.svelte +++ b/client/src/routes/[paste]/+page.svelte @@ -562,6 +562,10 @@ } } + .markdown { + padding: 0rem 1rem; + } + :global(.shiki), .markdown { border-bottom-left-radius: $border-radius; diff --git a/client/src/routes/changelog/+page.svelte b/client/src/routes/changelog/+page.svelte index f161fdc7..99e590ce 100755 --- a/client/src/routes/changelog/+page.svelte +++ b/client/src/routes/changelog/+page.svelte @@ -82,6 +82,5 @@ .content { margin-top: 1.5rem; - font-size: $fs-normal; }