@lambo-design/wang-editor 1.0.0-beta.12 → 1.0.0-beta.13
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 +3 -3
- package/src/index.vue +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/wang-editor",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@lambo-design/core": "^4.7.1-beta.
|
|
14
|
-
"@lambo-design/shared": "^1.0.0-beta.
|
|
13
|
+
"@lambo-design/core": "^4.7.1-beta.171",
|
|
14
|
+
"@lambo-design/shared": "^1.0.0-beta.316"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
package/src/index.vue
CHANGED
|
@@ -110,6 +110,18 @@ export default {
|
|
|
110
110
|
this.$emit('on-change', html, text)
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
self.editor.customConfig.linkCheck = (text, link) => {
|
|
114
|
+
console.log('linkCheck text', text)
|
|
115
|
+
console.log('linkCheck link', link)
|
|
116
|
+
if (!/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(link)) {
|
|
117
|
+
return '链接格式不正确,请输入有效的HTTP/HTTPS地址';
|
|
118
|
+
}
|
|
119
|
+
if (link.includes('javascript:')) {
|
|
120
|
+
return '禁止使用javascript协议';
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
113
125
|
// 根据 preservePasteStyle 属性决定是否保留粘贴样式
|
|
114
126
|
self.editor.customConfig.pasteFilterStyle = this.preservePasteStyle
|
|
115
127
|
// 设置触发事件间隔
|