Skip to content

Commit bd7596a

Browse files
committed
fix: decode HTML entities when copying task output to clipboard
NcRichContenteditable internally uses innerHTML which encodes < and > as &lt; and &gt;. When copying the result, these entities were copied literally instead of the actual characters. Fixes #432 Signed-off-by: shurik <shurik@users.noreply.github.com>
1 parent 151eed7 commit bd7596a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/fields/TextInput.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import axios from '@nextcloud/axios'
5959
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
6060
import { generateOcsUrl } from '@nextcloud/router'
6161
import { VALID_TEXT_MIME_TYPES, MAX_TEXT_INPUT_LENGTH } from '../../constants.js'
62+
import { parseSpecialSymbols } from '../../utils.js'
6263
6364
const picker = (callback, target) => getFilePickerBuilder(t('assistant', 'Choose a text file'))
6465
.setMimeTypeFilter(VALID_TEXT_MIME_TYPES)
@@ -184,7 +185,7 @@ export default {
184185
},
185186
async onCopy() {
186187
try {
187-
await navigator.clipboard.writeText(this.formattedValue)
188+
await navigator.clipboard.writeText(parseSpecialSymbols(this.formattedValue))
188189
this.copied = true
189190
setTimeout(() => {
190191
this.copied = false

0 commit comments

Comments
 (0)