@kvass/rich-text 1.4.15 → 1.4.17
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 +11 -2
package/package.json
CHANGED
package/src/Component.vue
CHANGED
|
@@ -258,13 +258,17 @@ export default {
|
|
|
258
258
|
.filter(Boolean)
|
|
259
259
|
.filter(cmd => !appearance || cmd.appearance[appearance])
|
|
260
260
|
},
|
|
261
|
+
|
|
261
262
|
setLink(value) {
|
|
262
263
|
let editor = this.editor.chain().focus()
|
|
263
264
|
switch (this.bubbleState) {
|
|
264
265
|
case 'link':
|
|
265
266
|
if (value)
|
|
266
267
|
editor
|
|
267
|
-
.setLink({
|
|
268
|
+
.setLink({
|
|
269
|
+
href: value,
|
|
270
|
+
target: this.isInternalUrl(value) ? '_self' : '_blank',
|
|
271
|
+
})
|
|
268
272
|
.run()
|
|
269
273
|
else editor.unsetLink().run()
|
|
270
274
|
break
|
|
@@ -308,7 +312,12 @@ export default {
|
|
|
308
312
|
],
|
|
309
313
|
content: this.value,
|
|
310
314
|
onUpdate: () => {
|
|
311
|
-
let html = this.editor
|
|
315
|
+
let html = this.editor
|
|
316
|
+
.getHTML()
|
|
317
|
+
.replace(/^<p>\s*<\/p>$/, '')
|
|
318
|
+
//remove rel="nofollow ..."
|
|
319
|
+
.replace(/\s*rel="[^"]*"/g, '')
|
|
320
|
+
|
|
312
321
|
this.$emit('input', html)
|
|
313
322
|
},
|
|
314
323
|
onSelectionUpdate: ({ editor }) => {
|