@lambo-design/wang-editor 1.0.0-beta.13 → 1.0.0-beta.15
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/index.vue +0 -2
- package/src/js/wang-editor.js +8 -1
package/package.json
CHANGED
package/src/index.vue
CHANGED
|
@@ -111,8 +111,6 @@ export default {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
self.editor.customConfig.linkCheck = (text, link) => {
|
|
114
|
-
console.log('linkCheck text', text)
|
|
115
|
-
console.log('linkCheck link', link)
|
|
116
114
|
if (!/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(link)) {
|
|
117
115
|
return '链接格式不正确,请输入有效的HTTP/HTTPS地址';
|
|
118
116
|
}
|
package/src/js/wang-editor.js
CHANGED
|
@@ -1371,7 +1371,14 @@
|
|
|
1371
1371
|
this._createPanel('', '');
|
|
1372
1372
|
} else {
|
|
1373
1373
|
// 选中内容了
|
|
1374
|
-
|
|
1374
|
+
var text = editor.selection.getSelectionText()
|
|
1375
|
+
if (!/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(text)) {
|
|
1376
|
+
alert('链接格式不正确,请选择有效的HTTP/HTTPS地址');
|
|
1377
|
+
}else if (text.includes('javascript:')) {
|
|
1378
|
+
alert('禁止选择javascript协议');
|
|
1379
|
+
}else {
|
|
1380
|
+
this._createPanel(text, '');
|
|
1381
|
+
}
|
|
1375
1382
|
}
|
|
1376
1383
|
}
|
|
1377
1384
|
},
|