1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-12 10:13:46 +02:00

add markdown support for description

This commit is contained in:
Andreas Brett 2023-02-20 16:09:17 +01:00 committed by GitHub
parent d1c43f432a
commit 372c6b9078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,9 @@
<div class="my-3"> <div class="my-3">
<label for="description" class="form-label">{{ $t("Description") }}</label> <label for="description" class="form-label">{{ $t("Description") }}</label>
<textarea id="description" v-model="config.description" class="form-control"></textarea> <textarea id="description" v-model="config.description" class="form-control"></textarea>
<div class="form-text">
{{ $t("markdownSupported") }}
</div>
</div> </div>
<!-- Footer Text --> <!-- Footer Text -->
@ -258,7 +261,9 @@
<!-- Description --> <!-- Description -->
<strong v-if="editMode">{{ $t("Description") }}:</strong> <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 v-if="editMode" class="mb-4">
<div> <div>
@ -500,6 +505,10 @@ export default {
return DOMPurify.sanitize(marked(this.incident.content)); return DOMPurify.sanitize(marked(this.incident.content));
}, },
descriptionHTML() {
return DOMPurify.sanitize(marked(this.config.description));
},
footerHTML() { footerHTML() {
return DOMPurify.sanitize(marked(this.config.footerText)); return DOMPurify.sanitize(marked(this.config.footerText));
}, },