2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-09-24 16:40:55 -06:00

Merge branch 'master' into status

This commit is contained in:
Jeroen Akkerman 2020-03-24 15:55:45 +01:00 committed by GitHub
commit 2d38e44411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 9 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `watch` task for gulp (Thanks to [@A-312], [#150].
### Fixed
- Issue with Marked when using IE11 and webpack (Thanks to [@felipefdl], [#169]).
- Updated codemirror to version 5.52.2 (Thanks to [@A-312], [#173]).
## [2.9.0] - 2020-01-13
### Added

20
package-lock.json generated
View File

@ -13,14 +13,20 @@
"@babel/highlight": "^7.8.3"
}
},
"@babel/helper-validator-identifier": {
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz",
"integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==",
"dev": true
},
"@babel/highlight": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz",
"integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==",
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz",
"integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.9.0",
"chalk": "^2.0.0",
"esutils": "^2.0.2",
"js-tokens": "^4.0.0"
}
},
@ -40,9 +46,9 @@
"dev": true
},
"@types/estree": {
"version": "0.0.43",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.43.tgz",
"integrity": "sha512-WfOySUnBpyKXbkC9QuZguwOGhGnugDXT2f2P6X8EIis7qlnd5NI1Nr4kRi357NtguxezyizIcaFlQe0wx23XnA==",
"version": "0.0.44",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.44.tgz",
"integrity": "sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g==",
"dev": true
},
"@types/marked": {

View File

@ -19,7 +19,7 @@
"license": "MIT",
"author": "Jeroen Akkerman",
"dependencies": {
"codemirror": "^5.51.0",
"codemirror": "^5.52.2",
"codemirror-spell-checker": "1.1.2",
"marked": "^0.8.0"
},

View File

@ -167,8 +167,13 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
el.classList.add('no-mobile');
}
// Prevent errors if there is no class name in custom options
var classNameParts = [];
if(typeof options.className !== 'undefined') {
classNameParts = options.className.split(' ');
}
// Provide backwards compatibility with simple-markdown-editor by adding custom classes to the button.
var classNameParts = options.className.split(' ');
var iconClasses = [];
for (var classNameIndex = 0; classNameIndex < classNameParts.length; classNameIndex++) {
var classNamePart = classNameParts[classNameIndex];
@ -191,6 +196,11 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
}
el.appendChild(icon);
// If there is a custom icon markup set, use that
if (typeof options.icon !== 'undefined') {
el.innerHTML = options.icon;
}
if (options.action && enableActions) {
if (typeof options.action === 'function') {
el.onclick = function (e) {