Added mardown support for incident

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
Matthew Nickson 2023-01-08 20:46:18 +00:00
parent 6bc0bd84af
commit 852a088529
No known key found for this signature in database
GPG Key ID: BF229DCFD4748E05

View File

@ -151,7 +151,12 @@
<Editable v-model="incident.title" tag="h4" :contenteditable="editIncidentMode" :noNL="true" class="alert-heading" />
<strong v-if="editIncidentMode">{{ $t("Content") }}:</strong>
<Editable v-model="incident.content" tag="div" :contenteditable="editIncidentMode" class="content" />
<Editable v-if="editIncidentMode" v-model="incident.content" tag="div" :contenteditable="editIncidentMode" class="content" />
<div v-if="editIncidentMode" class="form-text">
{{ $t("markdownSupported") }}
</div>
<!-- eslint-disable-next-line vue/no-v-html-->
<div v-if="! editIncidentMode" class="content" v-html="incidentHTML"></div>
<!-- Incident Date -->
<div class="date mt-3">
@ -484,6 +489,10 @@ export default {
return this.overallStatus === STATUS_PAGE_MAINTENANCE;
},
incidentHTML() {
return DOMPurify.sanitize(marked(this.incident.content));
},
footerHTML() {
return DOMPurify.sanitize(marked(this.config.footerText));
},