@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Component.vue +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvass/rich-text",
3
- "version": "1.4.15",
3
+ "version": "1.4.17",
4
4
  "description": "rich text component for kvass",
5
5
  "main": "index.js",
6
6
  "scripts": {
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({ href: value, target: this.isInternalUrl(value) ? '_self' : '_blank' })
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.getHTML().replace(/^<p>\s*<\/p>$/, '')
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 }) => {