@livingdocs/editable.js 3.0.5 → 3.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@livingdocs/editable.js",
3
3
  "description": "Friendly contenteditable API",
4
- "version": "3.0.5",
4
+ "version": "3.0.6",
5
5
  "dependencies": {
6
6
  "@babel/runtime": "^7.13.17",
7
7
  "bowser": "2.11.0",
@@ -9,21 +9,21 @@
9
9
  "rangy": "^1.3.0"
10
10
  },
11
11
  "devDependencies": {
12
- "@babel/cli": "^7.13.16",
13
- "@babel/core": "^7.13.16",
14
- "@babel/plugin-transform-runtime": "^7.13.15",
15
- "@babel/preset-env": "^7.13.15",
12
+ "@babel/cli": "^7.15.7",
13
+ "@babel/core": "^7.15.8",
14
+ "@babel/plugin-transform-runtime": "^7.15.8",
15
+ "@babel/preset-env": "^7.15.8",
16
16
  "@babel/preset-react": "^7.13.13",
17
17
  "@esm-bundle/chai": "^4.3.4-fix.0",
18
- "babel-loader": "^8.2.2",
18
+ "babel-loader": "^8.2.3",
19
19
  "babel-plugin-add-module-exports": "^1.0.4",
20
- "babel-plugin-istanbul": "^6.0.0",
21
- "css-loader": "^5.2.4",
22
- "eslint": "^7.24.0",
20
+ "babel-plugin-istanbul": "^6.1.1",
21
+ "css-loader": "^6.4.0",
22
+ "eslint": "^7.32.0",
23
23
  "eslint-plugin-react": "^7.23.2",
24
24
  "font-awesome": "^4.7.0",
25
25
  "gh-pages": "^3.1.0",
26
- "karma": "^6.3.2",
26
+ "karma": "^6.3.6",
27
27
  "karma-chrome-launcher": "^3.1.0",
28
28
  "karma-coverage": "^2.0.3",
29
29
  "karma-firefox-launcher": "^2.1.0",
@@ -31,9 +31,9 @@
31
31
  "karma-safari-launcher": "^1.0.0",
32
32
  "karma-sourcemap-loader": "^0.3.8",
33
33
  "karma-webpack": "^5.0.0",
34
- "mocha": "^9.0.3",
34
+ "mocha": "^9.1.3",
35
35
  "normalize.css": "^8.0.1",
36
- "prismjs": "^1.23.0",
36
+ "prismjs": "^1.25.0",
37
37
  "react": "^17.0.2",
38
38
  "react-dom": "^17.0.2",
39
39
  "react-transition-group": "^4.4.1",
@@ -41,9 +41,9 @@
41
41
  "sinon": "^10.0.0",
42
42
  "style-loader": "^2.0.0",
43
43
  "url-loader": "^4.1.1",
44
- "webpack": "^5.35.0",
45
- "webpack-cli": "^4.6.0",
46
- "webpack-dev-server": "^4.0.0-beta.3"
44
+ "webpack": "^5.60.0",
45
+ "webpack-cli": "^4.9.1",
46
+ "webpack-dev-server": "^4.3.1"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=12"
@@ -84,11 +84,11 @@
84
84
  "isCi": true,
85
85
  "name": "Drone",
86
86
  "service": "drone",
87
- "commit": "e07311419ac00b351b5760da9fbec8144b8fe7a3",
88
- "build": "361",
87
+ "commit": "371fd4f350c9d109eb57b0e68d2308702137f6c7",
88
+ "build": "376",
89
89
  "branch": "master",
90
90
  "isPr": false,
91
91
  "slug": "livingdocsIO/editable.js",
92
- "date": "2021-10-05T12:01:54.909Z"
92
+ "date": "2021-10-26T16:02:22.840Z"
93
93
  }
94
94
  }
package/src/selection.js CHANGED
@@ -78,7 +78,15 @@ export default class Selection extends Cursor {
78
78
  link (href, attrs = {}) {
79
79
  if (href) attrs.href = href
80
80
  const link = this.createElement(config.linkMarkup.name, config.linkMarkup.attribs)
81
- for (const key in attrs) link.setAttribute(key, attrs[key])
81
+ for (const key in attrs) {
82
+ const value = attrs[key]
83
+ if (value === undefined) continue
84
+ if (value === null) {
85
+ link.removeAttribute(key)
86
+ } else {
87
+ link.setAttribute(key, value)
88
+ }
89
+ }
82
90
  this.forceWrap(link)
83
91
  }
84
92