cm-md-editor 3.0.1 → 3.0.2

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/MdEditor.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-md-editor",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "a simple markdown editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/MdEditor.js CHANGED
@@ -122,7 +122,10 @@ export class MdEditor {
122
122
  }
123
123
 
124
124
  loadIcon(filename) {
125
- return this.loadIconFromUrl(new URL(filename, this.props.iconsPath).href)
125
+ const base = this.props.iconsPath.startsWith('http')
126
+ ? this.props.iconsPath
127
+ : new URL(this.props.iconsPath, window.location.href).href
128
+ return this.loadIconFromUrl(new URL(filename, base).href)
126
129
  }
127
130
 
128
131
  loadIconFromUrl(url) {