fix(dashboard): parse news messages as markdown
This commit is contained in:
parent
a5a8bb34c6
commit
6ec5031957
3 changed files with 19 additions and 6 deletions
|
|
@ -7,9 +7,12 @@
|
|||
CardText,
|
||||
} from "@sveltestrap/sveltestrap";
|
||||
import { DateTime } from "luxon";
|
||||
import { marked } from "marked";
|
||||
|
||||
export let message: NewsMessage;
|
||||
|
||||
$: content = marked.parse(message.content, { breaks: true });
|
||||
|
||||
$: postedAt = DateTime.fromISO(message.posted_at).toLocaleString(
|
||||
DateTime.DATETIME_MED,
|
||||
);
|
||||
|
|
@ -20,7 +23,7 @@
|
|||
|
||||
<Card>
|
||||
<CardBody>
|
||||
<CardText>{message.content}</CardText>
|
||||
<CardText>{@html content}</CardText>
|
||||
</CardBody>
|
||||
<CardFooter>
|
||||
From {message.author} • Posted {postedAt}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue