Skip to content

Commit

Permalink
Merge pull request #85 from aplijobs/enhancement/support-multiline-qu…
Browse files Browse the repository at this point in the history
…ick-replies

Enhancement | Support multi-line text in Interactive Messages
  • Loading branch information
cmm-apli authored May 17, 2023
2 parents 175e720 + 0c25247 commit 58c86c9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/javascript/shared/components/ChatOptions.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="chat-bubble agent" :class="$dm('bg-white', 'dark:bg-slate-700')">
<div
v-dompurify-html="formatMessage(message, false)"
v-dompurify-html="formattedMessage"
class="message-content"
:class="$dm('text-black-900', 'dark:text-slate-50')"
/>
Expand All @@ -13,13 +13,19 @@ import darkModeMixin from 'widget/mixins/darkModeMixin.js';
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
export default {
mixins: [messageFormatterMixin, darkModeMixin],
mixins: [darkModeMixin, messageFormatterMixin],
props: {
message: {
type: String,
default: '',
},
},
computed: {
formattedMessage() {
const messageWithLineBreak = this.message.replace(/\\n/g,'\n')
return this.formatMessage(messageWithLineBreak)
}
}
};
</script>

Expand Down

0 comments on commit 58c86c9

Please sign in to comment.