Merge pull request #2806 from andreasbrett/markdown_description

add markdown support for description
This commit is contained in:
Louis Lam 2023-02-21 16:19:14 +08:00 committed by GitHub
commit aad1a7e0fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,9 @@
<div class="my-3">
<label for="description" class="form-label">{{ $t("Description") }}</label>
<textarea id="description" v-model="config.description" class="form-control"></textarea>
<div class="form-text">
{{ $t("markdownSupported") }}
</div>
</div>
<!-- Footer Text -->
@ -258,7 +261,9 @@
<!-- Description -->
<strong v-if="editMode">{{ $t("Description") }}:</strong>
<Editable v-model="config.description" :contenteditable="editMode" tag="div" class="mb-4 description" />
<Editable v-if="enableEditMode" v-model="config.description" :contenteditable="editMode" tag="div" class="mb-4 description" />
<!-- eslint-disable-next-line vue/no-v-html-->
<div v-if="! enableEditMode" class="alert-heading p-2" v-html="descriptionHTML"></div>
<div v-if="editMode" class="mb-4">
<div>
@ -500,6 +505,10 @@ export default {
return DOMPurify.sanitize(marked(this.incident.content));
},
descriptionHTML() {
return DOMPurify.sanitize(marked(this.config.description));
},
footerHTML() {
return DOMPurify.sanitize(marked(this.config.footerText));
},