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

Commit

Permalink
share(string): generalize the preferred configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 14, 2022
1 parent 2f2e919 commit e6fca0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 2 additions & 8 deletions components/post/multiviewer/viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@

<script setup lang="ts">
import { ref, computed } from "vue"
import { Converter } from "showdown"
import type { DeserializedPostResource } from "$/types/documents/post"
import type {
Expand All @@ -182,6 +181,7 @@ import pluralize from "$/string/pluralize"
import makeSwitch from "$@/helpers/make_switch"
import isUndefined from "$/type_guards/is_undefined"
import specializePath from "$/helpers/specialize_path"
import convertMarkdownToHTML from "$/string/convert_markdown_to_html"
import formatToFriendlyPastTime from "$@/helpers/format_to_friendly_past_time"
import formatToCompleteFriendlyTime from "$@/helpers/format_to_complete_friendly_time"
Expand Down Expand Up @@ -212,13 +212,7 @@ interface CustomEvents {
const emit = defineEmits<CustomEvents>()
const post = ref<DeserializedPostResource<"poster"|"posterRole"|"department">>(props.modelValue)
const formattedContent = computed<string>(() => {
const converter = new Converter({
"backslashEscapesHTMLTags": true
})
converter.setFlavor("github")
return converter.makeHtml(post.value.content)
})
const formattedContent = computed<string>(() => convertMarkdownToHTML(post.value.content))
const hasExistingAttachments = computed<boolean>(() => {
const hasAttachments = !isUndefined(props.modelValue.postAttachments)
Expand Down
2 changes: 1 addition & 1 deletion pages/consultation/read.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ import ConsultationFetcher from "$@/fetchers/consultation"
import makeSwitch from "$@/helpers/make_switch"
import isUndefined from "$/type_guards/is_undefined"
import loadRemainingResource from "$@/helpers/load_remaining_resource"
import ChatMessageActivityFetcher from "$@/fetchers/chat_message_activity"
import convertTimeToMilliseconds from "$/time/convert_time_to_milliseconds"
import ConsultationTimerManager from "$@/helpers/consultation_timer_manager"
import loadRemainingResource from "$@/helpers/load_remaining_resource"
import ConsultationList from "@/consultation/list.vue"
import ChatWindow from "@/consultation/chat_window.vue"
Expand Down
5 changes: 4 additions & 1 deletion shareable/string/convert_markdown_to_html.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Converter } from "showdown"

export default function(raw: string): string {
const converter = new Converter()
const converter = new Converter({
"backslashEscapesHTMLTags": true
})
converter.setFlavor("github")
return converter.makeHtml(raw)
}

0 comments on commit e6fca0c

Please sign in to comment.