@lambo-design/wang-editor 1.0.0-beta.14 → 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/js/wang-editor.js +8 -1
package/package.json
CHANGED
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
|
},
|