@kvass/rich-text 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Component.vue +5 -2
package/package.json
CHANGED
package/src/Component.vue
CHANGED
|
@@ -102,7 +102,7 @@ import { Options } from '../index'
|
|
|
102
102
|
export { Tiptap }
|
|
103
103
|
export default {
|
|
104
104
|
name: 'RichText',
|
|
105
|
-
inject:
|
|
105
|
+
inject: { RichTextOptions: { default: null } },
|
|
106
106
|
props: {
|
|
107
107
|
value: {
|
|
108
108
|
type: String,
|
|
@@ -349,7 +349,10 @@ export default {
|
|
|
349
349
|
],
|
|
350
350
|
content: this.value,
|
|
351
351
|
onUpdate: () => {
|
|
352
|
-
|
|
352
|
+
const html = this.editor.getHTML()
|
|
353
|
+
if (/^<p>\s*<\/p>$/.test(html)) return this.$emit('input', '')
|
|
354
|
+
|
|
355
|
+
return this.$emit('input', html)
|
|
353
356
|
},
|
|
354
357
|
onSelectionUpdate: ({ editor }) => {
|
|
355
358
|
if (!this.bubbleShouldShow({ editor })) this.bubbleState = null
|