@kvass/rich-text 1.5.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvass/rich-text",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "rich text component for kvass",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Component.vue CHANGED
@@ -349,7 +349,10 @@ export default {
349
349
  ],
350
350
  content: this.value,
351
351
  onUpdate: () => {
352
- this.$emit('input', this.editor.getHTML())
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