mirror of
https://github.com/abhinavxd/libredesk.git
synced 2025-11-13 10:25:44 +00:00
feat: Adds support for <a> tags in tiptap editor content
- feat: adds new tiptap extension - `@tiptap/extension-link` - Fix: show rendered text instead of HTML in canned responses list preview
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, watchEffect, onUnmounted } from 'vue'
|
||||
|
||||
import { useEditor, EditorContent } from '@tiptap/vue-3'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import Image from '@tiptap/extension-image'
|
||||
import StarterKit from '@tiptap/starter-kit'
|
||||
import Link from '@tiptap/extension-link'
|
||||
|
||||
const emit = defineEmits([
|
||||
'send',
|
||||
@@ -47,7 +47,8 @@ const editor = ref(
|
||||
placeholder: () => {
|
||||
return props.placeholder
|
||||
}
|
||||
})
|
||||
}),
|
||||
Link,
|
||||
],
|
||||
autofocus: true,
|
||||
editorProps: {
|
||||
@@ -111,7 +112,7 @@ watch(
|
||||
() => props.contentToSet,
|
||||
(newContent) => {
|
||||
if (newContent) {
|
||||
editor.value.commands.setContent(newContent, false, {
|
||||
editor.value.commands.setContent(newContent, false,{
|
||||
preserveWhitespace: "full"
|
||||
})
|
||||
editor.value.commands.focus()
|
||||
@@ -142,4 +143,15 @@ onUnmounted(() => {
|
||||
overflow-y: scroll !important;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.tiptap {
|
||||
a {
|
||||
color: #0066cc;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #003d7a;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user