Skip to content

Commit 79c7f3b

Browse files
committed
make converted html computed to ensure it gets updated if markdown changes
1 parent b7a5209 commit 79c7f3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/src/components/MarkdownComponent.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import showdown from "showdown";
3+
import { computed } from "vue";
34
45
const props = defineProps({
56
markdown: {
@@ -9,7 +10,9 @@ const props = defineProps({
910
});
1011
1112
const markdownConverter = new showdown.Converter();
12-
const convertedHtml = markdownConverter.makeHtml(props.markdown);
13+
const convertedHtml = computed(() =>
14+
markdownConverter.makeHtml(props.markdown),
15+
);
1316
</script>
1417

1518
<template>

0 commit comments

Comments
 (0)