mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-11-30 02:32:51 +05:30
Add support to markdown
This commit is contained in:
parent
9126593eba
commit
fc4cbc0b08
@ -35,6 +35,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/core": "^0.2.5",
|
"@auth/core": "^0.2.5",
|
||||||
"@auth/sveltekit": "^0.1.12",
|
"@auth/sveltekit": "^0.1.12",
|
||||||
"joi": "^17.7.0"
|
"joi": "^17.7.0",
|
||||||
|
"snarkdown": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
696
pnpm-lock.yaml
generated
696
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@
|
|||||||
import Hero from "$lib/Hero.svelte";
|
import Hero from "$lib/Hero.svelte";
|
||||||
import sanitizeHtml from "sanitize-html";
|
import sanitizeHtml from "sanitize-html";
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
|
import snarkdown from 'snarkdown';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@ -46,12 +47,12 @@
|
|||||||
|
|
||||||
{#if data.announcements.incident.content}
|
{#if data.announcements.incident.content}
|
||||||
<p>
|
<p>
|
||||||
{@html sanitizeHtml(
|
{@html snarkdown(sanitizeHtml(
|
||||||
data.announcements.incident.content.replace(
|
data.announcements.incident.content.replace(
|
||||||
/\n/g,
|
/\n/g,
|
||||||
"<br />"
|
"<br />"
|
||||||
)
|
)
|
||||||
)}
|
))}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user