Skip to content

Commit

Permalink
fix: KTextArea does not display strike text (close #1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Jan 14, 2025
1 parent 96fe5bd commit cdfbc61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions core/client/components/KTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div
class="q-pr-lg"
:class="{ 'k-textarea-collapsed': !isExpanded, 'k-textarea-expanded': isExpanded }"
v-html="sanitizedText"
v-html="Document.sanitizeHtml(props.text)"
/>
</KScrollArea>
<div class="k-expandable-action">
Expand All @@ -39,7 +39,7 @@
<script setup>
import _ from 'lodash'
import { ref, computed, watch } from 'vue'
import sanitizeHtml from 'sanitize-html'
import { Document } from '../document.js'
import KExpandable from './KExpandable.vue'
import KScrollArea from './KScrollArea.vue'
Expand Down Expand Up @@ -68,10 +68,6 @@ const props = defineProps({
isExpanded: {
type: Boolean,
default: false
},
sanitizeOptions: {
type: Object,
default: () => null
}
})
Expand All @@ -83,9 +79,6 @@ const isExpanded = ref(props.isExpanded)
const isScrollable = ref(false)
// computed
const sanitizedText = computed(() => {
return _.get(props, 'sanitizeOptions') ? sanitizeHtml(props.text, props.sanitizeOptions) : sanitizeHtml(props.text)
})
const cssCursor = computed(() => {
return isExpandable.value ? 'pointer' : 'default'
})
Expand Down
2 changes: 1 addition & 1 deletion core/client/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Document = {
scrollableViewers: ['document/KHtml', 'document/KMarkdown', 'document/KCsv']
},
htmlSanitizer: {
allowedTags: sanitize.defaults.allowedTags.concat(['img'])
allowedTags: sanitize.defaults.allowedTags.concat(['img', 'strike'])
},
mdConverter: {}
})
Expand Down

0 comments on commit cdfbc61

Please # to comment.