enable Markdown on comments and recipe timeline events

This commit is contained in:
p0lycarpio 2023-11-24 10:41:58 +01:00
parent be43e5bccd
commit 645421b566
2 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,7 @@
<v-card outlined class="flex-grow-1"> <v-card outlined class="flex-grow-1">
<v-card-text class="pa-3 pb-0"> <v-card-text class="pa-3 pb-0">
<p class="">{{ comment.user.username }} {{ $d(Date.parse(comment.createdAt), "medium") }}</p> <p class="">{{ comment.user.username }} {{ $d(Date.parse(comment.createdAt), "medium") }}</p>
{{ comment.text }} <SafeMarkdown :source="comment.text" />
</v-card-text> </v-card-text>
<v-card-actions class="justify-end mt-0 pt-0"> <v-card-actions class="justify-end mt-0 pt-0">
<v-btn <v-btn
@ -60,11 +60,13 @@ import { Recipe, RecipeCommentOut } from "~/lib/api/types/recipe";
import UserAvatar from "~/components/Domain/User/UserAvatar.vue"; import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
import { NoUndefinedField } from "~/lib/api/types/non-generated"; import { NoUndefinedField } from "~/lib/api/types/non-generated";
import { usePageUser } from "~/composables/recipe-page/shared-state"; import { usePageUser } from "~/composables/recipe-page/shared-state";
import SafeMarkdown from "~/components/global/SafeMarkdown.vue";
export default defineComponent({ export default defineComponent({
components: { components: {
UserAvatar, UserAvatar,
}, SafeMarkdown
},
props: { props: {
recipe: { recipe: {
type: Object as () => NoUndefinedField<Recipe>, type: Object as () => NoUndefinedField<Recipe>,

View File

@ -85,7 +85,7 @@
@error="hideImage = true" @error="hideImage = true"
/> />
<div v-if="event.eventMessage" :class="useMobileFormat ? 'text-caption' : ''"> <div v-if="event.eventMessage" :class="useMobileFormat ? 'text-caption' : ''">
{{ event.eventMessage }} <SafeMarkdown :source="event.eventMessage" />
</div> </div>
</v-col> </v-col>
</v-row> </v-row>
@ -101,9 +101,10 @@ import RecipeTimelineContextMenu from "./RecipeTimelineContextMenu.vue";
import { useStaticRoutes } from "~/composables/api"; import { useStaticRoutes } from "~/composables/api";
import { Recipe, RecipeTimelineEventOut } from "~/lib/api/types/recipe" import { Recipe, RecipeTimelineEventOut } from "~/lib/api/types/recipe"
import UserAvatar from "~/components/Domain/User/UserAvatar.vue"; import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
import SafeMarkdown from "~/components/global/SafeMarkdown.vue";
export default defineComponent({ export default defineComponent({
components: { RecipeCardMobile, RecipeTimelineContextMenu, UserAvatar }, components: { RecipeCardMobile, RecipeTimelineContextMenu, UserAvatar, SafeMarkdown },
props: { props: {
event: { event: {