Merge branch 'development'

typescriptify 2.2.1
Unknown 6 years ago
commit 7fda2e09dd

@ -4,3 +4,6 @@ end_of_line=lf
insert_final_newline=true insert_final_newline=true
indent_style=space indent_style=space
indent_size=4 indent_size=4
[*.{yml,yaml}]
indent_size=2

@ -7,4 +7,4 @@ First of all, thanks for your interest in helping make EasyMDE even better. Cont
- If you really want to earn some brownie points, create a JSFiddle that demonstrates your code changes. Seriously, this helps immensely and allows one or multiple people to easily provide feedback on the great work you've done. - If you really want to earn some brownie points, create a JSFiddle that demonstrates your code changes. Seriously, this helps immensely and allows one or multiple people to easily provide feedback on the great work you've done.
- When creating the JSFiddle, keep in mind that you can use http://rawgit.com for your files. - When creating the JSFiddle, keep in mind that you can use http://rawgit.com for your files.
- Do your best to fully test your changes. Anticipate edge-case behavior. - Do your best to fully test your changes. Anticipate edge-case behavior.
- Try to keep your codebase that you're making changes to as up-to-date as possible with the origin. SimpleMDE creates new releases frequently, so it's easy to fall behind if you've been working on something new for a while. - Try to keep your codebase that you're making changes to as up-to-date as possible with the origin. EasyMDE creates new releases frequently, so it's easy to fall behind if you've been working on something new for a while.

1
.gitignore vendored

@ -7,3 +7,4 @@ node_modules/
*.iws *.iws
.idea/ .idea/
.vscode/ .vscode/
dev_test/

@ -6,3 +6,20 @@ node_js:
before_script: before_script:
- npm install -g gulp - npm install -g gulp
script: gulp script: gulp
deploy:
- provider: npm
email: info@saturnserver.org
api_key:
secure: VswGN/y8Tu9as13qQRd/zKcMRo7lpa9BWYYyw+LN4uRaustVzmFY0akOPInaajGyxvHvn9A8hY+ASNeUnpRcnVfHSNdtBlLltMm62dXVxqrWZl5cI07rXc1yerL5YcnuC8jEO9bm3lbkXL6fUt7pgk59wgEdZjUPaIpELY/1/H33RLpLGJ1P8JeIzUwuV6RqJcoULoEFoJruXWEjM+OkaJQt1z+/1JgXVxhGS/6NnKmf0pyZM+ULvgmF1l5YGwUfQl4miB8I7+GeWuYvPSDqL3YgLpxrmnw2uW4a120XtMf30awpGTF9iPZqc5VIQyOJ/8A2myGmm/r2RWXyn3WWQUYwmb4HDIuvbIGTGhW9Zd1X3Kjb14DFeD26ZB11ynOwGZPQC51rF0chK+O3PF56QKMsu8Qx56g8+pU4g3qP2txwAQjh89fTsx8I04Om/XwyoZ3eSQLkX/12oD1FcE7Fv30bVEiegN+hH3SiIofWBhhV0tUJjlrCHGgxMXb2e6XnJh9ePuvUOTW9AeWwYEQRpqnM1n6zIPci/dwGDNP9sYGBRsRMGdHlExP8FecM5/vL/3XHidk2PuRNM0BLDLibDVkwzwnHNQkpPuzrr57MKcScYy6VyLxErk88VGzNb8oZ6NFRQYmWgjX6bdFBfZFo5snB49tgRpWpCbiF5SBMNnQ=
on:
tags: true
branch: master
repo: Ionaru/easy-markdown-editor
- provider: npm
email: info@saturnserver.org
api_key:
secure: VswGN/y8Tu9as13qQRd/zKcMRo7lpa9BWYYyw+LN4uRaustVzmFY0akOPInaajGyxvHvn9A8hY+ASNeUnpRcnVfHSNdtBlLltMm62dXVxqrWZl5cI07rXc1yerL5YcnuC8jEO9bm3lbkXL6fUt7pgk59wgEdZjUPaIpELY/1/H33RLpLGJ1P8JeIzUwuV6RqJcoULoEFoJruXWEjM+OkaJQt1z+/1JgXVxhGS/6NnKmf0pyZM+ULvgmF1l5YGwUfQl4miB8I7+GeWuYvPSDqL3YgLpxrmnw2uW4a120XtMf30awpGTF9iPZqc5VIQyOJ/8A2myGmm/r2RWXyn3WWQUYwmb4HDIuvbIGTGhW9Zd1X3Kjb14DFeD26ZB11ynOwGZPQC51rF0chK+O3PF56QKMsu8Qx56g8+pU4g3qP2txwAQjh89fTsx8I04Om/XwyoZ3eSQLkX/12oD1FcE7Fv30bVEiegN+hH3SiIofWBhhV0tUJjlrCHGgxMXb2e6XnJh9ePuvUOTW9AeWwYEQRpqnM1n6zIPci/dwGDNP9sYGBRsRMGdHlExP8FecM5/vL/3XHidk2PuRNM0BLDLibDVkwzwnHNQkpPuzrr57MKcScYy6VyLxErk88VGzNb8oZ6NFRQYmWgjX6bdFBfZFo5snB49tgRpWpCbiF5SBMNnQ=
tag: next
on:
branch: development
repo: Ionaru/easy-markdown-editor

@ -10,6 +10,7 @@ Changes include:
* Small styling changes * Small styling changes
* Support for Node 8 and beyond * Support for Node 8 and beyond
* Lots of refactored code * Lots of refactored code
* Links in preview will open in a new tab by default
My intention is to continue development on this project, improving it and keeping it alive. My intention is to continue development on this project, improving it and keeping it alive.

@ -1,5 +1,5 @@
/** /**
* easymde v2.0.1 * easymde v2.1.0
* Copyright Jeroen Akkerman * Copyright Jeroen Akkerman
* @link https://github.com/ionaru/easy-markdown-editor * @link https://github.com/ionaru/easy-markdown-editor
* @license MIT * @license MIT

File diff suppressed because one or more lines are too long

102
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "easymde", "name": "easymde",
"version": "2.0.1", "version": "2.2.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -332,9 +332,9 @@
} }
}, },
"async-done": { "async-done": {
"version": "1.2.4", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/async-done/-/async-done-1.2.4.tgz", "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.1.tgz",
"integrity": "sha512-mxc+yISkb0vjsuvG3dJCIZXzRWjKndQ9Zo9zNDJ1K2wh9eP0E0oGmOWm+4cFOvW4dA0tGFImTW5tQJHCtn1kIQ==", "integrity": "sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg==",
"dev": true, "dev": true,
"requires": { "requires": {
"end-of-stream": "^1.1.0", "end-of-stream": "^1.1.0",
@ -963,9 +963,9 @@
"dev": true "dev": true
}, },
"codemirror": { "codemirror": {
"version": "5.37.0", "version": "5.39.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.37.0.tgz", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.39.0.tgz",
"integrity": "sha512-dQaayDJCLU4UJcwg2RM44oFrs0dMNndTp6qxQJF6XI71l1xN3RB4IqiKES0b0rccbARbrD/UBB4t8DNknfaOTw==" "integrity": "sha512-vpJRray/0ZCt9FiS7UcVr1JAm6OBdUt6TA/94Q7MScr8TnutVdQWh/WPr0migzaBPQmYvY7I9UZNvbsaLESIuQ=="
}, },
"codemirror-spell-checker": { "codemirror-spell-checker": {
"version": "1.1.2", "version": "1.1.2",
@ -1104,9 +1104,9 @@
"dev": true "dev": true
}, },
"copy-props": { "copy-props": {
"version": "2.0.3", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.3.tgz", "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz",
"integrity": "sha512-Q5jXiqCOvlQc1Nvy2txrVg9ZexZ0UAw9NBQ7/s3cZ7SCAm0WD7NNsLwwcy+xvNwuVBbfkF2+4SBcz1L1AWbtmw==", "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==",
"dev": true, "dev": true,
"requires": { "requires": {
"each-props": "^1.3.0", "each-props": "^1.3.0",
@ -1410,9 +1410,9 @@
} }
}, },
"each-props": { "each-props": {
"version": "1.3.1", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.1.tgz", "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz",
"integrity": "sha1-/BOPUeOid0KG1IWOAtbn3kYt4Vg=", "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-plain-object": "^2.0.1", "is-plain-object": "^2.0.1",
@ -1999,14 +1999,14 @@
"dev": true "dev": true
}, },
"fsevents": { "fsevents": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
"integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"nan": "^2.9.2", "nan": "^2.9.2",
"node-pre-gyp": "^0.9.0" "node-pre-gyp": "^0.10.0"
}, },
"dependencies": { "dependencies": {
"abbrev": { "abbrev": {
@ -2087,7 +2087,7 @@
} }
}, },
"deep-extend": { "deep-extend": {
"version": "0.4.2", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true "optional": true
@ -2265,7 +2265,7 @@
} }
}, },
"node-pre-gyp": { "node-pre-gyp": {
"version": "0.9.1", "version": "0.10.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true, "optional": true,
@ -2374,12 +2374,12 @@
"optional": true "optional": true
}, },
"rc": { "rc": {
"version": "1.2.6", "version": "1.2.7",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"deep-extend": "~0.4.0", "deep-extend": "^0.5.1",
"ini": "~1.3.0", "ini": "~1.3.0",
"minimist": "^1.2.0", "minimist": "^1.2.0",
"strip-json-comments": "~2.0.1" "strip-json-comments": "~2.0.1"
@ -2761,9 +2761,9 @@
} }
}, },
"gulp-rename": { "gulp-rename": {
"version": "1.2.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz", "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.3.tgz",
"integrity": "sha1-OtRCh2PwXidk3sHGfYaNsnVoeBc=", "integrity": "sha512-CmdPM0BjJ105QCX1fk+j7NGhiN/1rCl9HLGss+KllBS/tdYadpjTxqdKyh/5fNV+M3yjT1MFz5z93bXdrTyzAw==",
"dev": true "dev": true
}, },
"gulp-uglify": { "gulp-uglify": {
@ -3033,9 +3033,9 @@
} }
}, },
"insert-module-globals": { "insert-module-globals": {
"version": "7.0.6", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.6.tgz", "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.1.0.tgz",
"integrity": "sha512-R3sidKJr3SsggqQQ5cEwQb3pWG8RNx0UnpyeiOSR6jorRIeAOzH2gkTWnNdMnyRiVbjrG047K7UCtlMkQ1Mo9w==", "integrity": "sha512-LbYZdybvKjbbcKLp03lB323Cgc8f0iL0Rjh8U6JZ7K1gZSf7MxQH191iCNUcLX4qIQ6/yWe4Q4ZsQ+opcReNFg==",
"dev": true, "dev": true,
"requires": { "requires": {
"JSONStream": "^1.0.3", "JSONStream": "^1.0.3",
@ -3584,9 +3584,9 @@
} }
}, },
"marked": { "marked": {
"version": "0.3.19", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-0.4.0.tgz",
"integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==" "integrity": "sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw=="
}, },
"matchdep": { "matchdep": {
"version": "2.0.0", "version": "2.0.0",
@ -3713,9 +3713,9 @@
} }
}, },
"module-deps": { "module-deps": {
"version": "6.0.2", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.2.tgz", "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz",
"integrity": "sha512-KWBI3009iRnHjRlxRhe8nJ6kdeBTg4sMi5N6AZgg5f1/v5S7EBCRBOY854I4P5Anl4kx6AJH+4bBBC2Gi3nkvg==", "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"JSONStream": "^1.0.3", "JSONStream": "^1.0.3",
@ -4244,9 +4244,9 @@
} }
}, },
"pumpify": { "pumpify": {
"version": "1.5.0", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.0.tgz", "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
"integrity": "sha512-UWi0klDoq8xtVzlMRgENV9F7iCTZExaJQSQL187UXsxpk9NnrKGqTqqUNYAKGOzucSOxs2+jUnRNI+rLviPhJg==", "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"duplexify": "^3.6.0", "duplexify": "^3.6.0",
@ -4824,9 +4824,9 @@
"dev": true "dev": true
}, },
"sparkles": { "sparkles": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
"integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==",
"dev": true "dev": true
}, },
"spdx-correct": { "spdx-correct": {
@ -5233,9 +5233,9 @@
"integrity": "sha1-VNjrx5SfGngQkItgAsaEFSbJnVo=" "integrity": "sha1-VNjrx5SfGngQkItgAsaEFSbJnVo="
}, },
"uglify-js": { "uglify-js": {
"version": "3.3.24", "version": "3.3.25",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.24.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.25.tgz",
"integrity": "sha512-hS7+TDiqIqvWScCcKRybCQzmMnEzJ4ryl9ErRmW4GFyG48p0/dKZiy/5mVLbsFzU8CCnCgQdxMiJzZythvLzCg==", "integrity": "sha512-hobogryjDV36VrLK3Y69ou4REyrTApzUblVFmdQOYRe8cYaSmFJXMb4dR9McdvYDSbeNdzUgYr2YVukJaErJcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"commander": "~2.15.0", "commander": "~2.15.0",
@ -5382,9 +5382,9 @@
} }
}, },
"upath": { "upath": {
"version": "1.0.5", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.0.5.tgz", "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz",
"integrity": "sha512-qbKn90aDQ0YEwvXoLqj0oiuUYroLX2lVHZ+b+xwjozFasAOC4GneDq5+OaIG5Zj+jFmbz/uO+f7a9qxjktJQww==", "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==",
"dev": true "dev": true
}, },
"urix": { "urix": {
@ -5444,9 +5444,9 @@
"dev": true "dev": true
}, },
"v8flags": { "v8flags": {
"version": "3.0.2", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.2.tgz", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.0.tgz",
"integrity": "sha512-6sgSKoFw1UpUPd3cFdF7QGnrH6tDeBgW1F3v9gy8gLY0mlbiBXq8soy8aQpY6xeeCjH5K+JvC62Acp7gtl7wWA==", "integrity": "sha512-0m69VIK2dudEf2Ub0xwLQhZkDZu85OmiOpTw+UGDt56ibviYICHziM/3aE+oVg7IjGPp0c83w3eSVqa+lYZ9UQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"homedir-polyfill": "^1.0.1" "homedir-polyfill": "^1.0.1"
@ -5493,9 +5493,9 @@
} }
}, },
"vinyl-fs": { "vinyl-fs": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.2.tgz", "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz",
"integrity": "sha512-AUSFda1OukBwuLPBTbyuO4IRWgfXmqC4UTW0f8xrCa8Hkv9oyIU+NSqBlgfOLZRoUt7cHdo75hKQghCywpIyIw==", "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==",
"dev": true, "dev": true,
"requires": { "requires": {
"fs-mkdirp-stream": "^1.0.0", "fs-mkdirp-stream": "^1.0.0",

@ -1,6 +1,6 @@
{ {
"name": "easymde", "name": "easymde",
"version": "2.0.1", "version": "2.2.1",
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.", "description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.",
"keywords": [ "keywords": [
"embeddable", "embeddable",
@ -9,16 +9,16 @@
"javascript", "javascript",
"fontawesome" "fontawesome"
], ],
"main": "./src/js/simplemde.js", "main": "./src/js/easymde.js",
"license": "MIT", "license": "MIT",
"author": "Jeroen Akkerman", "author": "Jeroen Akkerman",
"bugs": { "bugs": {
"url": "https://github.com/ionaru/easy-markdown-editor/issues" "url": "https://github.com/ionaru/easy-markdown-editor/issues"
}, },
"dependencies": { "dependencies": {
"codemirror": "^5.37.0", "codemirror": "^5.39.0",
"codemirror-spell-checker": "1.1.2", "codemirror-spell-checker": "1.1.2",
"marked": "0.3.19" "marked": "^0.4.0"
}, },
"devDependencies": { "devDependencies": {
"browserify": "^16.2.2", "browserify": "^16.2.2",
@ -27,7 +27,7 @@
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-eslint": "^4.0.0", "gulp-eslint": "^4.0.0",
"gulp-header": "^2.0.5", "gulp-header": "^2.0.5",
"gulp-rename": "^1.2.2", "gulp-rename": "^1.2.3",
"gulp-uglify": "^3.0.0", "gulp-uglify": "^3.0.0",
"vinyl-buffer": "^1.0.0", "vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^2.0.0" "vinyl-source-stream": "^2.0.0"

@ -16,6 +16,7 @@ var marked = require('marked');
// Some variables // Some variables
var isMac = /Mac/.test(navigator.platform); var isMac = /Mac/.test(navigator.platform);
var anchorToExternalRegex = new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g);
// Mapping of actions that can be bound to keyboard shortcuts or toolbar buttons // Mapping of actions that can be bound to keyboard shortcuts or toolbar buttons
var bindings = { var bindings = {
@ -77,6 +78,25 @@ var isMobile = function () {
return check; return check;
}; };
/**
* Modify HTML to add 'target="_blank"' to links so they open in new tabs by default.
* @param {string} htmlText - HTML to be modified.
* @return {string} The modified HTML text.
*/
function addAnchorTargetBlank(htmlText) {
var match;
while ((match = anchorToExternalRegex.exec(htmlText)) !== null) {
// With only one capture group in the RegExp, we can safely take the first index from the match.
var linkString = match[0];
if (linkString.indexOf('target=') === -1) {
var fixedLinkString = linkString.replace(/>$/, ' target="_blank">');
htmlText = htmlText.replace(linkString, fixedLinkString);
}
}
return htmlText;
}
/** /**
* Fix shortcut. Mac use Command, others use Ctrl. * Fix shortcut. Mac use Command, others use Ctrl.
@ -1477,13 +1497,16 @@ EasyMDE.prototype.markdown = function (text) {
} }
} }
// Set options // Set options
marked.setOptions(markedOptions); marked.setOptions(markedOptions);
// Convert the markdown to HTML
var htmlText = marked(text);
// Edit the HTML anchors to add 'target="_blank"' by default.
htmlText = addAnchorTargetBlank(htmlText);
// Return return htmlText;
return marked(text);
} }
}; };
@ -1548,6 +1571,13 @@ EasyMDE.prototype.render = function (el) {
mode.gitHubSpice = false; mode.gitHubSpice = false;
} }
// eslint-disable-next-line no-unused-vars
function configureMouse(cm, repeat, event) {
return {
addNew: false
};
}
this.codemirror = CodeMirror.fromTextArea(el, { this.codemirror = CodeMirror.fromTextArea(el, {
mode: mode, mode: mode,
backdrop: backdrop, backdrop: backdrop,
@ -1562,6 +1592,7 @@ EasyMDE.prototype.render = function (el) {
allowDropFileTypes: ['text/plain'], allowDropFileTypes: ['text/plain'],
placeholder: options.placeholder || el.getAttribute('placeholder') || '', placeholder: options.placeholder || el.getAttribute('placeholder') || '',
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : !isMobile(), styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : !isMobile(),
configureMouse: configureMouse
}); });
this.codemirror.getScrollerElement().style.minHeight = options.minHeight; this.codemirror.getScrollerElement().style.minHeight = options.minHeight;

Loading…
Cancel
Save