-
Notifications
You must be signed in to change notification settings - Fork 42
Support the panelists description (Modal.vue) in markdown format. #700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
👷 Deploy request for classy-granita-bc2b5a pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for zesty-gnome-f04144 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes of panel-discussion.i18n.js LGTM
Updated, PTaL! @serkodev |
Thanks for the update. @gkirchou If we use the Click to view suggested patchdiff --git a/components/core/modal/Modal.vue b/components/core/modal/Modal.vue
index b4283c797..9e3ff9541 100644
--- a/components/core/modal/Modal.vue
+++ b/components/core/modal/Modal.vue
@@ -22,12 +22,7 @@
</div>
<div class="lightBox__intro">
<p class="text-sm">{{ intro }}</p>
- <MarkdownRenderer
- v-if="descriptionIsHtml"
- class="text-sm"
- :markdown="sanitizedDescription"
- />
- <div v-else>
+ <div v-if="Array.isArray(description)">
<div
v-for="(item, i) in description"
:key="i"
@@ -36,6 +31,11 @@
{{ item }}
</div>
</div>
+ <MarkdownRenderer
+ v-else-if="typeof description === 'string'"
+ class="text-sm"
+ :markdown="description"
+ />
</div>
<div v-if="websiteUrl" class="lightBox__buttons">
<text-button
@@ -51,7 +51,6 @@
</template>
<script>
-import DOMPurify from 'dompurify'
import i18n from '../../core/modal/Modal.i18n'
import MarkdownRenderer from '~/components/core/markdown/MarkdownRenderer'
import TextButton from '~/components/core/buttons/TextButton'
@@ -70,21 +69,13 @@ export default {
name: { type: String, default: '' },
intro: { type: String, default: '' },
websiteUrl: { type: String, default: '' },
- description: { type: Array, default: () => [] },
- descriptionIsHtml: { type: Boolean, default: false },
+ description: { type: [Array, String], default: () => [] },
},
data() {
return {
shouldShowModal: this.value,
}
},
- computed: {
- sanitizedDescription() {
- return this.descriptionIsHtml
- ? DOMPurify.sanitize(this.description[0])
- : this.description
- },
- },
watch: {
value(newVal) {
this.shouldShowModal = newVal
diff --git a/pages/conference/panel-discussion.vue b/pages/conference/panel-discussion.vue
index eb99a43e8..2dcd9abfd 100644
--- a/pages/conference/panel-discussion.vue
+++ b/pages/conference/panel-discussion.vue
@@ -113,7 +113,6 @@
:img-urls="getSpeakerPhoto(selectedItem)"
:name="getSpeakerName(selectedItem)"
:description="getSpeakerDescription(selectedItem)"
- :description-is-html="true"
/>
</transition>
</div>
@@ -239,7 +238,7 @@ export default {
const markdownText = Array.isArray(participant.description)
? participant.description.join('\n\n')
: participant.description
- return [this.$md.render(markdownText)]
+ return markdownText
},
},
head() { |
Types of changes
Description
Steps to Test This Pull Request
Expected behavior
Related Issue
N/A 目前沒開,要的話我再開。