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:
Abhinav Raut
2024-10-24 20:07:23 +05:30
parent f1b4007d7d
commit 4d67aa463f
5 changed files with 39 additions and 7 deletions

View File

@@ -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>