Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
feat(post): render post with new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 14, 2022
1 parent 36418dc commit 6fc668c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/post/multiviewer/viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
@restore-post="confirmRestore"/>
</div>
</header>
<p class="post-content">
{{ post.content }}
<p v-html="formattedContent" class="post-content">
</p>
<div v-if="hasExistingAttachments">
<div
Expand Down Expand Up @@ -212,6 +211,7 @@ interface CustomEvents {
const emit = defineEmits<CustomEvents>()
const post = ref<DeserializedPostResource<"poster"|"posterRole"|"department">>(props.modelValue)
const formattedContent = computed<string>(() => post.value.content.replace(/\r?\n/gu, "<br>"))
const hasExistingAttachments = computed<boolean>(() => {
const hasAttachments = !isUndefined(props.modelValue.postAttachments)
Expand Down

0 comments on commit 6fc668c

Please sign in to comment.