1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

fix: markdown list padding and replace nuxtjs/mdc (#5577)

This commit is contained in:
Kuchenpirat 2025-06-26 21:58:31 +02:00 committed by GitHub
parent ca9d5677b8
commit af274bf476
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 1286 deletions

View file

@ -1,12 +1,11 @@
<template>
<MDC
:value="value"
tag="article"
/>
<!-- eslint-disable-next-line vue/no-v-html is safe here because all HTML is sanitized with DOMPurify in setup() -->
<div v-html="value" />
</template>
<script lang="ts">
import DOMPurify from "isomorphic-dompurify";
import { marked } from "marked";
export default defineNuxtComponent({
props: {
@ -40,7 +39,8 @@ export default defineNuxtComponent({
}
const value = computed(() => {
return sanitizeMarkdown(props.source) || "";
const rawHtml = marked.parse(props.source || "", { async: false });
return sanitizeMarkdown(rawHtml);
});
return {
@ -56,7 +56,8 @@ export default defineNuxtComponent({
width: 100%;
}
:deep(th, td) {
:deep(th),
:deep(td) {
border: 1px solid;
padding: 8px;
text-align: left;
@ -65,4 +66,10 @@ export default defineNuxtComponent({
:deep(th) {
font-weight: bold;
}
:deep(ul),
:deep(ol) {
margin: 8px 0;
padding-left: 20px;
}
</style>