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

Compare commits

...

1214 Commits

Author SHA1 Message Date
Jeroen Akkerman
2996b67ec9
Update README.md 2025-05-01 18:41:05 +02:00
Jeroen akkerman
1708e40c42 2.20.0 2025-03-04 18:01:55 +01:00
Jeroen akkerman
f1e229f5b8 Update changelog for 2.20.0 2025-03-04 17:59:40 +01:00
Jeroen akkerman
a602d3b826 Add support for marked extensions
Fixes #514
Fixes #611
2025-02-21 22:31:16 +01:00
Jeroen akkerman
fe680f09f6 2.19.0 2025-02-18 01:12:05 +01:00
Jeroen akkerman
0eddf94930 Update changelog for 2.19.0 2025-02-18 01:10:31 +01:00
Jeroen Akkerman
22ce228b07
Merge pull request #608 from mayraamaral/master
chore: adjust the regex for previewing images so that it only attempts to render if the image has a bracket immediately preceding the parentheses
2025-02-18 00:56:58 +01:00
Jeroen akkerman
e7a56e11dd Add a test for the parentheses problem 2025-02-18 00:53:11 +01:00
Mayra Amaral
f20ff16b81
Merge branch 'Ionaru:master' into master 2025-02-17 20:39:59 -03:00
Jeroen Akkerman
c93033bb4e
Merge pull request #609 from mayraamaral/v4
chore: update actions to v4
2025-02-18 00:05:45 +01:00
Jeroen akkerman
c1b06a9613 Add Node.js version to artifact name 2025-02-18 00:01:28 +01:00
Mayra Amaral
bdfd0da5ff chore: update actions to v4 2025-02-14 21:41:15 -03:00
Mayra Amaral
138c198852 chore: adjust regex from previewing images to only try to render if image has bracket before of parentheses 2025-02-11 16:05:13 -03:00
Jeroen Akkerman
a6b121f2e6
Merge pull request #592 from p1gp1g/fix/image-processing
Avoid processing many times the same image
2024-06-07 12:34:49 +02:00
Jeroen Akkerman
65dfecf484
Merge pull request #591 from p1gp1g/fix/relative-img-url
Fix relative image url fetched from stylesheet domain
2024-06-07 12:18:18 +02:00
S1m
97bf9ce8fd Avoid processing many times the same image
Cache img key during processing to avoid having to process it
thousands of times
2024-06-04 14:39:15 +02:00
S1m
9b420ac103 Fix relative image url fetched from stylesheet domain
Partial URLs are interpreted relative to the source of
the style sheet, not relative to the document
https://www.w3.org/TR/CSS1/
2024-06-04 14:32:24 +02:00
Jeroen Akkerman
f039bae67f
Merge pull request #573 from robinvandernoord/custom-image-input-name-option
Allow setting a custom `name` for the upload-image input
2023-12-21 21:35:00 +01:00
Robin van der Noord
c68bdf148a
Allow setting a custom name for the upload-image input 2023-12-18 10:57:48 +01:00
Jeroen Akkerman
35587a9477 Update dependencies, fixes #562 2023-09-27 00:52:59 +02:00
Jeroen Akkerman
d9ab397b88
Update demo URL
fixes #526
2023-04-28 02:40:34 +02:00
Jeroen Akkerman
abead2a068
Update build status badge 2023-01-12 15:34:45 +01:00
Jeroen Akkerman
c25adab400
Merge pull request #519 from borodean/update-status-bar-typing 2023-01-12 15:14:11 +01:00
Jeroen Akkerman
a49e867930
Merge pull request #520 from borodean/upload-image-typing 2023-01-12 15:14:04 +01:00
Vadym Borodin
cb5564e1b2 Expose the "upload-image" variant for ToolbarButton 2023-01-12 14:44:10 +02:00
Vadym Borodin
fbc181f5c8 Expose the updateStatusBar type 2023-01-12 14:38:17 +02:00
Jeroen akkerman
041594ae4a 2.18.0 2022-09-20 16:45:08 +02:00
Jeroen akkerman
6ab32d9fd6 Update changelog for 2.18.0 2022-09-20 16:44:48 +02:00
Jeroen akkerman
950f689dc7 Update codemirror 2022-09-20 16:41:06 +02:00
Jeroen akkerman
6560950b65 Update workflow file 2022-09-18 02:20:36 +02:00
Jeroen akkerman
f60c9b24c5 Update dependencies 2022-09-18 01:08:09 +02:00
Jeroen akkerman
4b48564730 Revert example html 2022-09-17 23:08:33 +02:00
Jeroen akkerman
d26b4e399b Add toolbarButtonClassPrefix option
Fixes #493
2022-09-17 23:07:24 +02:00
Jeroen akkerman
84aafddd92 Add extra typing tests for previewRender 2022-08-20 18:19:18 +02:00
Jeroen akkerman
4a73c911d0 2.17.0 2022-08-20 18:14:26 +02:00
Jeroen akkerman
086e73b835 Update changelog for 2.17.0 2022-08-20 18:14:21 +02:00
Jeroen akkerman
aa2f225340 Add past merges to README 2022-08-20 18:10:14 +02:00
Jeroen akkerman
0062ba38e1 Update dependencies 2022-08-20 17:26:20 +02:00
Jeroen akkerman
f8a66b120b Edit regex pattern for Safari browser, fixes #478 2022-08-20 17:25:49 +02:00
Jeroen Akkerman
b4c55d9075
Merge pull request #471 from LevitatingOrange/detachedPreviewRendering 2022-08-20 17:24:15 +02:00
Jeroen Akkerman
c27f5d1d23
Merge pull request #492 from vanillajonathan/patch-1 2022-08-17 01:45:27 +02:00
Jonathan
f7b4fbfda5
Add support for Header size 4, 5, 6 2022-08-12 12:15:42 +02:00
Jeroen Akkerman
d22fd40625
Merge pull request #488 from LoyalPotato/master 2022-07-28 17:51:08 +02:00
David Bazílio Ribeiro
9ddbc4a585 Fix type for hideIcons 2022-07-27 17:58:51 +01:00
Jeroen akkerman
03f018a472 Migrate cypress files 2022-07-27 18:35:35 +02:00
Jeroen akkerman
9232608bf3 Fix changelog 2022-07-27 18:19:50 +02:00
Jeroen akkerman
2930abdd50 Update dependencies 2022-07-27 18:18:24 +02:00
Jeroen Akkerman
b347a911c1
Merge pull request #486 from hlf20010508/master 2022-07-27 18:09:50 +02:00
Jeroen Akkerman
3e653dc900
Merge pull request #484 from kicksent/patch-1
Fix typo in readme
2022-07-27 18:09:14 +02:00
L-ING
acbed01b34
Add missed "upload-image" icon 2022-07-24 13:58:19 +08:00
Nick Trierweiler
ef827ba61f
Fix typo in readme
This is meant to be "italic" not "italics" which will render an empty icon here. The docs specify this as well and I tested locally while working through implementing this on a project.
2022-07-15 15:07:19 -04:00
Jeroen Akkerman
37561e4458
Merge pull request #479 from hackerwins/fix-invalid-icons 2022-06-27 18:36:08 +02:00
hackerwins
03fec127eb Fix invalid icons 2022-06-27 09:30:56 +09:00
Jeroen Akkerman
4d065c361e
Merge pull request #454 from vanillajonathan/patch-8
Refactor into using a map for icon classes
2022-06-16 17:25:43 +02:00
Jonathan
78fcda535d
Update easymde.js 2022-06-16 14:09:13 +02:00
Jeroen Akkerman
c84af4c3ed Fix hyperlink doubling
Closes #25
Closes #95
Closes #281
2022-06-16 10:52:01 +02:00
Jeroen Akkerman
c311b7b8da Merge branch 'master' of https://github.com/Ionaru/easy-markdown-editor 2022-06-16 10:48:49 +02:00
Jeroen Akkerman
3d6d56edef
Merge pull request #467 from vanillajonathan/patch-1
Use classList.add and classList.remove
2022-06-16 10:47:54 +02:00
Lennart Vogelsang
67f75535ad
Updated documentation 2022-06-07 20:11:27 +02:00
Lennart Vogelsang
8295aa6a5a
Changed: ignore output of previewRender if it is null 2022-06-07 19:55:27 +02:00
Jeroen Akkerman
7338ddb6e3 Replace remaining className usages 2022-05-24 12:25:09 +02:00
Jeroen Akkerman
96a5aac921 Add testing on Node.js 18 2022-05-24 11:46:38 +02:00
Jeroen Akkerman
0c31e06928 Update dependencies 2022-05-24 11:39:56 +02:00
Jonathan
23f241bd47
Use classList.add and classList.remove 2022-05-23 19:05:42 +02:00
Jonathan
fc839e8dc8
Update README.md 2022-05-22 21:17:59 +02:00
Jonathan
0eab3e11e8
Update easymde.js 2022-05-22 20:43:55 +02:00
Jeroen Akkerman
e4610b3763
Merge pull request #452 from vanillajonathan/patch-4
Use Responsive Font Sizes
2022-05-22 18:55:07 +02:00
Jeroen Akkerman
24feffcba6
Merge pull request #464 from vanillajonathan/patch-1
Add ARIA role=application
2022-05-22 18:47:33 +02:00
Jeroen Akkerman
e57c16bc5c
Merge pull request #461 from vanillajonathan/patch-12 2022-05-22 18:45:14 +02:00
Jeroen Akkerman
eb51f0fe53
Merge pull request #466 from vanillajonathan/patch-5
Fix inconsistent border color
2022-05-22 18:41:39 +02:00
Jonathan
554112b05f
Update easymde.css 2022-05-22 18:25:49 +02:00
Jonathan
2972b280a5
Update easymde.css 2022-05-22 18:19:21 +02:00
Jonathan
eee701ef86
Update easymde.js 2022-05-22 18:15:02 +02:00
Jonathan
7f9ba6abc8
Fix inconsistent border color 2022-05-22 17:57:58 +02:00
Jeroen Akkerman
3895e0a607
Merge pull request #451 from vanillajonathan/patch-7
Add keyboard shortcuts for headings
2022-05-22 14:14:45 +02:00
Jonathan
b675e611a4
Update easymde.css 2022-05-22 12:22:39 +02:00
Jonathan
3cc99e47ae
Add ARIA role=application 2022-05-22 12:04:03 +02:00
Jonathan
f4a02e39a9
Update README.md 2022-05-22 11:38:09 +02:00
Jonathan
4714577c36
Update easymde.js 2022-05-22 11:34:31 +02:00
Jeroen Akkerman
45e0f36685
Merge pull request #463 from vanillajonathan/patch-1
Add ARIA attribute to button
2022-05-22 02:08:17 +02:00
Jonathan
cd9bbe7939
Add ARIA attribute to button 2022-05-22 00:17:53 +02:00
Jonathan
5a4af7e38a
Update easymde.css 2022-05-22 00:02:10 +02:00
Jeroen Akkerman
611aa50443
Merge pull request #455 from vanillajonathan/patch-9
Set role attribute on the toolbar
2022-05-21 11:38:52 +02:00
Jeroen Akkerman
68d33ec2c1
Merge pull request #459 from vanillajonathan/patch-2
Accept APNG for image uploads
2022-05-19 23:54:33 +02:00
Jonathan
855a5d72f5
Update README.md 2022-05-19 22:57:16 +02:00
Jonathan
38717daffe
Add support for text buttons 2022-05-19 22:49:29 +02:00
Jonathan
146a5e3fb1
Accept APNG for image uploads 2022-05-19 19:02:14 +02:00
Jeroen Akkerman
c311bfa6b0
Merge pull request #458 from vanillajonathan/patch-2
Accept AVIF for image uploads
2022-05-19 14:40:51 +02:00
Jonathan
b31cf2bf7c
Accept AVIF for image uploads 2022-05-19 12:20:40 +02:00
Jonathan
bed6b493c8
Update easymde.js 2022-05-19 10:14:11 +02:00
Jeroen Akkerman
2b178671ca
Merge pull request #449 from vanillajonathan/patch-2
Add actions for header size 4, 5 and 6
2022-05-19 09:37:22 +02:00
Jonathan
2666001eda
Set role attribute on the toolbar 2022-05-18 22:03:48 +02:00
Jonathan
21fda66d3d
Update easymde.js 2022-05-18 19:45:35 +02:00
Jonathan
9d74ea296c
Refactor into using a map for icon classes 2022-05-18 19:39:39 +02:00
Jonathan
1706b4b0cf
Use Responsive Font Sizes 2022-05-18 18:35:45 +02:00
Jeroen Akkerman
aca4b5c816
Merge pull request #450 from vanillajonathan/patch-6
Accept GIF for image uploads
2022-05-18 01:54:43 +02:00
Jonathan
757d5eb729
Add keyboard shortcuts for headings 2022-05-18 00:54:20 +02:00
Jonathan
be1d994322
Update easymde.js 2022-05-18 00:50:08 +02:00
Jonathan
0dd2f99f9d
Accept GIF for image uploads 2022-05-18 00:39:54 +02:00
Jonathan
9a57f00d92
Update easymde.js 2022-05-17 23:25:02 +02:00
Jonathan
332cf61086
Add header size 4, 5 and 6 2022-05-17 23:17:04 +02:00
Jonathan
c1071c8539
Add header size 4, 5 and 6 2022-05-17 23:15:13 +02:00
Jeroen Akkerman
16b1de652e Update dependencies 2022-05-17 14:42:41 +02:00
Jeroen Akkerman
8b9cf3e812
Merge pull request #444 from vanillajonathan/patch-2 2022-05-17 13:24:08 +02:00
Jonathan
a433f72891
Update README.md
Co-authored-by: Jeroen Akkerman <Jeroen_akkerman1@hotmail.com>
2022-05-17 11:12:46 +02:00
Jonathan
4b3930c4a7
Update README.md 2022-05-17 00:26:02 +02:00
Jeroen Akkerman
a7fb5d8f06
Merge pull request #436 from vanillajonathan/patch-2
Add missing undo and redo actions
2022-05-16 23:01:58 +02:00
Jeroen Akkerman
7b4c6dae9e
Merge pull request #438 from vanillajonathan/patch-3
Use <kbd> markup element for keyboard shortcuts
2022-05-16 23:00:06 +02:00
Jeroen Akkerman
b6f207d235
Merge pull request #440 from vanillajonathan/patch-5
Fix broken markdown
2022-05-16 22:57:47 +02:00
Jonathan
591e278745
Fix broken markdown 2022-05-16 21:57:06 +02:00
Jonathan
764ce93d59
Use <kbd> markup element for keyboard shortcuts 2022-05-16 16:38:53 +02:00
Jonathan
af81424b78
Add missing undo and redo actions 2022-05-16 16:23:25 +02:00
Jeroen Akkerman
3d07f0eb97 Update dependencies 2022-04-23 22:06:59 +02:00
Jeroen Akkerman
16f2dde59d Fix #399 autofocus property 2022-04-04 15:45:12 +02:00
Jeroen Akkerman
57f72bd5ae Merge branch 'master' of https://github.com/Ionaru/simplemde-markdown-editor 2022-04-04 15:43:02 +02:00
Jeroen Akkerman
8765cf197b
Merge pull request #417 from sghoweri/patch-1 2022-03-23 20:32:49 +01:00
Salem Cobalt
bf9b0108d7
Handle Webp Image Uploads
With this fix, uploaded WebP images render as links in the markdown (vs images).
2022-03-23 14:45:32 -04:00
Jeroen Akkerman
f283f76f5c Update dependencies 2022-03-19 23:25:58 +01:00
Jeroen Akkerman
a1ad87986d Merge branch 'master' of https://github.com/Ionaru/simplemde-markdown-editor 2022-03-12 01:54:17 +01:00
Jeroen Akkerman
76fda35bf9
Merge pull request #411 from diego-gw/imagePreviewHandler 2022-03-12 01:53:27 +01:00
Jeroen Akkerman
1f30a11773 Add changelog entry 2022-03-12 01:45:14 +01:00
Diego Garcia Weber
aa711787b2 clarified readme description of parameter, removed extra parantheses from type 2022-03-07 10:58:09 -05:00
Jeroen Akkerman
853efd8a5e Update dependencies 2022-03-06 21:30:06 +01:00
Diego Garcia Weber
ed196be5a0 added option to readme, imagesPreviewHandler to types and defensive check that the handler provided by the user returns a string 2022-03-01 20:47:30 -05:00
Diego Garcia Weber
d8fa00e460 Adds the option to add a handler for images preview 2022-03-01 17:15:35 -05:00
Jeroen Akkerman
f573560bb4 Update dependencies 2022-02-15 01:19:04 +01:00
Jeroen Akkerman
a021bdf8ae
Merge pull request #394 from ZsgsDesign/master
Add robust CSRF support and provide default values for CSRF fields
2022-02-14 15:15:00 +01:00
ZsgsDesign
aa6fe59e93 fixed default image configuration typo 2022-01-25 16:46:06 +08:00
ZsgsDesign
8805c379d8 fixed comment typo for csrf token 2022-01-24 12:24:27 +08:00
ZsgsDesign
b0d20adc6e add instances example for imageCSRFToken 2022-01-24 12:07:07 +08:00
ZsgsDesign
f3dca2e82a add robust CSRF support and provide default values for CSRF fields 2022-01-24 12:05:00 +08:00
Jeroen Akkerman
50d3680017
Merge pull request #393 from Zignature/escape-url-via-prompt
Fix #373 Encode and escape URLs entered via prompt
2022-01-17 00:17:36 +01:00
Jeroen Akkerman
81ec7780bc Update changelog 2022-01-17 00:13:40 +01:00
Jeroen Akkerman
d8eae5d74c Improve readability of encode/escape functionality 2022-01-17 00:13:40 +01:00
Jeroen Akkerman
0c2cf4cd51 Add tests for url prompts 2022-01-17 00:13:40 +01:00
Zignature
16545eb0e1 Made escaping prompt URLs automatic instead of optional again 2022-01-16 00:14:00 +01:00
Zignature
47f1e4f892 Updated readme and easymde.d.ts to reflect escapePrompURLs option 2022-01-15 23:56:27 +01:00
Zignature
c174b6f149 Changed function name escapeURI to escapedPromptURL and option escapeURLs to option escapePromptURLs 2022-01-15 23:34:05 +01:00
Zignature
33489ab616 URL encoding and escaping for JS prompt URLs
- URL encoding and escaping added for JS prompt entered URLs
- added option escapeURLs (boolean)
2022-01-15 23:26:10 +01:00
Zignature
5d0294f5f5 Fix issue #373 problems in urls with special characters
Added function to escape URLs entered via JS prompt.

It's a partial fix because people cannot be stopped entering URLs manually and forgetting to escape them.
2022-01-15 13:20:28 +01:00
Jeroen Akkerman
4fb35f2758 2.16.1 2022-01-14 23:27:44 +01:00
Jeroen Akkerman
d0116608e6 Update changelog for 2.16.1 2022-01-14 23:27:23 +01:00
Jeroen Akkerman
6159ed1383 Update marked to resolve security vulnerability 2022-01-14 23:23:54 +01:00
Jeroen Akkerman
a56badd0dc Add test for markdown rendering 2022-01-14 23:09:20 +01:00
Jeroen Akkerman
24d86491da Fix incorrect initial line and column count 2022-01-14 22:33:35 +01:00
Jeroen Akkerman
56532f9ce4 Add cypress tests 2022-01-14 22:27:43 +01:00
Jeroen Akkerman
722fb61ed2 Remove old travis build status badge 2022-01-11 21:51:01 +01:00
Jeroen Akkerman
33a4043dbb Update build status badge 2022-01-11 21:50:30 +01:00
Jeroen Akkerman
75fe53f062 2.16.0 2022-01-11 21:44:56 +01:00
Jeroen Akkerman
384655f968 Update changelog for 2.16.0 2022-01-11 21:44:50 +01:00
Jeroen Akkerman
6445f3c2d9
Merge pull request #388 from Zignature/options-toolbarbutton-attributes
Fix for issue #380 Custom attributes for toolbar buttons
2022-01-11 21:41:22 +01:00
Jeroen Akkerman
7a2373eae5 Update changelog 2022-01-11 21:40:13 +01:00
Jeroen Akkerman
4ddb5b8e1b Add toolbar button attributes to type declaration 2022-01-11 21:38:36 +01:00
Jeroen Akkerman
98d9049728 Move adding custom attributes above all others 2022-01-11 21:30:34 +01:00
Jeroen Akkerman
565c42e0ff Add hasOwnProperty check 2022-01-11 21:28:22 +01:00
Jeroen Akkerman
1c656d5712 Merge branch 'master' into options-toolbarbutton-attributes 2022-01-11 21:23:42 +01:00
Jeroen Akkerman
c1da7424e9
Merge pull request #389 from Zignature/options-liststyle
Fix for issue #386 Show '-' instead of '*' for unordered list
2022-01-11 21:22:31 +01:00
Jeroen Akkerman
e2db3c6946 Attempt at improving submenus in Safari for #362 2022-01-11 20:10:00 +01:00
Jeroen Akkerman
267db2dbe3 Update changelog 2022-01-11 19:56:18 +01:00
Jeroen Akkerman
9862ecf98c Add unorderedListStyle option to type declaration 2022-01-11 19:49:39 +01:00
Zignature
2cdc11848a Requested changes applied 2022-01-11 17:16:38 +01:00
Zignature
5df842b630 Fix for issue #386 Show '-' instead of '*' for unordered list
Added unorderedListStyle to the options
2022-01-11 15:45:36 +01:00
Zignature
a9d9993dae Fix for issue #380 Custom attributes for toolbar buttons
Added "attributes" option to custom toolbar button
2022-01-11 11:00:56 +01:00
Jeroen Akkerman
59a676bc8a
Merge pull request #384 from Zignature/ZignatureEasyMDE
Fix #381 Accurate line and column count in status bar
2022-01-08 21:53:54 +01:00
Zignature
2936fc3383 Accurate line and column count in status bar
Both Line and column (character) count are increased by 1.

This fixes issue #381
2022-01-08 21:03:25 +01:00
Zignature
a7170b9392 Fix issue #381 2022-01-08 16:01:19 +01:00
Jeroen Akkerman
598821b6bb Add typings and tests for 'direction' option 2021-10-28 11:33:17 +02:00
Jeroen Akkerman
de1cd3b293 Update changelog for 2.16.0 2021-10-28 11:29:44 +02:00
Jeroen Akkerman
d27adc6a16 Update dependencies 2021-10-28 01:59:33 +02:00
Jeroen Akkerman
c15c699a52 Update changelog for PR #364 2021-10-28 01:53:59 +02:00
Jeroen Akkerman
8ad896fb40
Merge pull request #364 from robjean9/master
update easymde.css, fix issue #362
2021-10-27 23:51:32 +02:00
Robson Jean Penteado
b640429f19 fix issue #362 2021-10-27 14:47:43 -03:00
Robson Jean Penteado
8ef68936b0 update easymde.css, fix issue #362 2021-10-27 14:42:25 -03:00
Jeroen Akkerman
f004c2d0c3 More small README improvements 2021-10-10 01:04:28 +02:00
Jeroen Akkerman
551c84bc01 Fix indenting and some leftover old JS 2021-10-06 01:51:02 +02:00
Jeroen Akkerman
86e40bcf4a Update README with some more modern JS 2021-10-06 01:43:47 +02:00
Jeroen Akkerman
35b42c404a Update changelog 2021-10-05 22:42:24 +02:00
Jeroen Akkerman
42304e8a87 Update editorconfig and automatic code format 2021-10-05 22:28:22 +02:00
Jeroen Akkerman
dc38624378 Update dependencies 2021-10-05 22:19:04 +02:00
Jeroen Akkerman
c24dd01880 Drop testing support on older Node.js versions 2021-10-05 22:18:55 +02:00
Jeroen Akkerman
b364a6095a Use Github Actions instead of Tavis 2021-10-05 22:07:43 +02:00
Jeroen Akkerman
cda237031f
Merge pull request #357 from ukjinjang/fix/compare_image_extension
Convert media file extension to lowercase before check if image
2021-10-05 21:59:15 +02:00
Jeroen Akkerman
534e2cadee
Merge pull request #358 from souljuse/master
Add support for RTL languages
2021-10-05 21:59:05 +02:00
Irene Oppo
aafd40f35b Add direction option to README 2021-10-05 10:04:05 +02:00
Irene Oppo
53223c4de0 Support rtl languages by adding a direction option 2021-10-05 09:51:51 +02:00
Uk-Jin Jang
b121795887 fix: convert media file extension to lowercase before check if image 2021-10-05 15:50:48 +09:00
Jeroen Akkerman
0f559258c5
Merge pull request #338 from mrlugilugi/fix-error-formatting-asterisks-as-unordered-list
fix: Formatting asterisks divided by space results in console error #337
2021-06-16 21:30:53 +02:00
Jeroen Akkerman
3e403d9712
Merge pull request #339 from CamilleDrapier/add-cleanup-to-ts
Add the cleanup function to TypeScript definition
2021-06-16 21:30:43 +02:00
Camille Drapier
cb351333d1 Add cleanup function to TypeScript definition 2021-06-10 16:18:35 +09:00
mrlugilugi
f52f9807a2
fix: Escaping asterisk to produce valid RegEx 2021-06-09 13:14:20 +02:00
Jeroen Akkerman
c1d35b04c5
Merge pull request #333 from smundro/custom-spellchecker
Allow for specifying a custom spell-checker
2021-05-23 16:13:24 +02:00
Steve
737aa13709 add a dash 2021-05-18 16:12:44 -07:00
Steve
038a9204b4 Allow for specifying a custom spell-checker for EasyMDE 2021-05-18 16:05:40 -07:00
Jeroen Akkerman
dbab7e95e7 2.15.0 2021-04-22 22:41:34 +02:00
Jeroen Akkerman
51d496aea6 Update changelog for 2.15.0 2021-04-22 22:41:27 +02:00
Jeroen Akkerman
735d31fb29 Update dependencies 2021-04-22 22:39:01 +02:00
Jeroen Akkerman
ebcc835ee9 Update changelog 2021-04-22 22:37:27 +02:00
Jeroen Akkerman
c58eb54379
Merge pull request #322 from marekdedic/320-fix
Exposing types as non-dev dependencies
2021-04-12 19:33:22 +02:00
Marek Dědič
529c7bf04d
Fixes #320 2021-04-12 13:05:26 +02:00
Jeroen Akkerman
e3480c2f60 Update dependencies 2021-04-09 19:22:31 +02:00
Jeroen Akkerman
fc0ecfa77e
Merge pull request #313 from wwsalmon/absolute-image-paths
Absolute image paths
2021-04-08 18:05:14 +02:00
Jeroen Akkerman
113c5b45b1
Merge pull request #316 from smundro/bugfix-fullscreen-sidebyside-handle
Bugfix: Correctly keep preview active during fullscreen-toggle
2021-03-27 16:29:15 +01:00
Steve
b61fe7945a Add simple class handling utiltity to DRY adding/removing class names.
Note that this isn't necessary and can be rolled back, but could be used throughout the code to make class handling more clear and consistent.
2021-03-17 11:17:14 -07:00
Steve
82a8e4a8ce restore removed comment 2021-03-17 10:46:18 -07:00
Steve
548229dd1a remove added comment 2021-03-17 10:45:45 -07:00
Steve
40ddcea4e3 remove extra comment updates 2021-03-17 10:44:46 -07:00
Steve
d0f69390ce a little comment/cleanup 2021-03-17 10:41:38 -07:00
Steve
1ee8519e50 Unwind all the onlyCleanup stuff and set classes directly. 2021-03-17 10:25:39 -07:00
Steve
4533dd4776 clarify comments in togglePreview 2021-03-16 09:21:03 -07:00
Steve
d636eb7407 clean up diff 2021-03-16 09:17:19 -07:00
Steve
7069fd1031 Move from multiple "no-fullscreen" classes to one using inheritance 2021-03-16 09:08:54 -07:00
Steve
d76872f4ff undo some comment changes to make diff cleaner 2021-03-15 20:15:39 -07:00
Steve
8ed6cd699e make toggle cleanup flag clearer 2021-03-15 20:13:26 -07:00
Steve
25db654cf0 more code cleanup for readibilty 2021-03-15 20:08:38 -07:00
Steve
8702dd22d0 correct test page title 2021-03-15 19:57:47 -07:00
Steve
fa8855e3be code refactoring to improve readability 2021-03-15 19:40:57 -07:00
Steve
61e93a3d53 handle fullscreen toggle consistently by adusting toggleSideBySide 2021-03-15 19:30:56 -07:00
Steve
abbec5bde1 bugfix: move sidebyside accessor outside of options check 2021-03-15 13:53:08 -07:00
Samson Zhang
3b755026d6 update readme with imagePathAbsolute option info 2021-03-11 12:14:44 -07:00
Samson Zhang
6e7e8f9b82 add imagePathAbsolute option 2021-03-11 12:09:09 -07:00
Jeroen Akkerman
072176a86e
Merge pull request #311 from deerboy/patch-1
Fixed extension acquisition logic
2021-03-08 15:59:03 +01:00
Daichi Ninomiya
c2dbe77615
fix(easymde.js): Fixed extension acquisition logic 2021-03-08 23:48:57 +09:00
Jeroen Akkerman
95b848a825
Merge pull request #308 from ChronosMasterOfAllTime/307-fix-toolbaricon-typing
Resolve Issue #307 - add optional icon field to ToolbarIcon interface in easymde.d.ts
2021-02-26 17:13:21 +01:00
ChronosMasterOfAllTime
6527a311a3 #307 - add optional icon field to ToolbarIcon interface in easymde.d.ts 2021-02-26 09:06:01 -06:00
Jeroen Akkerman
8fa54c496f Fix changelog version link 2021-02-14 13:13:25 +01:00
Jeroen Akkerman
fdc9ce4935 2.14.0 2021-02-14 13:11:48 +01:00
Jeroen Akkerman
0ac130306d Update changelog for 2.14.0 2021-02-14 13:10:53 +01:00
Jeroen Akkerman
59b6b0719e Update dependencies 2021-02-14 12:53:26 +01:00
Jeroen Akkerman
bc17533def
Merge pull request #293 from sn3p/toolbar-top-and-bottom-padding
Add toolbar top and bottom padding
2021-02-14 12:50:21 +01:00
Jeroen Akkerman
0241584921
Merge pull request #298 from Ionaru/dependabot/npm_and_yarn/marked-2.0.0
Bump marked from 1.2.6 to 2.0.0
2021-02-10 19:27:25 +01:00
dependabot[bot]
dd449cf9a7
Bump marked from 1.2.6 to 2.0.0
Bumps [marked](https://github.com/markedjs/marked) from 1.2.6 to 2.0.0.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v1.2.6...v2.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 21:27:50 +00:00
Matthijs Kuiper
ec94037ac2 Add toolbar top and bottom padding 2021-01-28 20:28:29 +01:00
Jeroen Akkerman
0ff81e89a6
Merge pull request #286 from smundro/retain-preview-on-fullscreen-toggle
don't toggle preview if sideBySideFullscreen is false
2020-12-31 17:27:54 +01:00
Jeroen Akkerman
65f66138c0
Merge pull request #285 from Situphen/dropdown
Use visibility:hidden; instead of display:none; for the dropdown menu
2020-12-31 17:27:40 +01:00
Jeroen Akkerman
3f90b9fe72
Merge pull request #284 from Fanvadar/fix-spellchecker
Fix spell checker
2020-12-31 17:27:31 +01:00
Steve
480145264a don't toggle preview if sideBySideFullscreen is false 2020-12-30 13:49:11 -08:00
Situphen
a070698b34 Use visibility:hidden; instead of display:none; for the dropdown menu 2020-12-30 21:59:45 +01:00
Alexander Wilson
7b0411fd79 Fix spell checker 2020-12-29 11:58:40 +10:00
Jeroen Akkerman
1386fb0319
Merge pull request #280 from emirotin/patch-1
Fix #278
2020-12-28 16:43:50 +01:00
Jeroen Akkerman
80e2fc1bbd Merge remote-tracking branch 'origin/master' 2020-12-28 16:42:16 +01:00
Jeroen Akkerman
dbe3872afb Update demo website link in README
Closes #283
2020-12-28 16:41:50 +01:00
Eugene Mirotin
b7d5af36c8
Fix #278
Remove erroneous and unneeded call to window.removeEventListener
2020-12-22 13:38:39 +02:00
Jeroen Akkerman
67592df8bf
Merge pull request #277 from Juupaa/drag_and_drop_link
Drag and drop a file checks the extension to either create an image or link
2020-12-17 19:35:05 +01:00
Marc-Etienne Trudel
db348fe44b
wip 2020-12-16 14:18:19 -05:00
Jeroen Akkerman
3b6402b3e8 Update dependencies 2020-12-12 00:40:56 +01:00
Jeroen Akkerman
a7f4262166 Update changelog for PR #272 2020-12-12 00:38:19 +01:00
Jeroen Akkerman
6306b96cf7
Merge pull request #272 from joahim/master
Fix the sideBySideFullscreen=false + status=false bug
2020-12-09 14:13:27 +01:00
Joh Dokler
c428a37ee3 Fix additional edge case for the sideBySideFullscreen=false + status=false bug 2020-12-09 12:08:15 +01:00
Joh Dokler
2a904b24ab Fix the sideBySideFullscreen=false + status=false bug 2020-12-09 11:58:57 +01:00
Jeroen Akkerman
f286a6bae5
Merge pull request #250 from danice/scrollbar-styles
Include Codemirror scrollbar style property
2020-11-11 22:59:59 +01:00
Jeroen Akkerman
6209e53c69
Merge pull request #253 from devforth/master
Bugfixes for preview images in editor
2020-11-11 22:57:08 +01:00
Jeroen Akkerman
62b95316b2 2.13.0 2020-11-11 22:54:38 +01:00
Jeroen Akkerman
7efef3b003 Update changelog for 2.13.0 2020-11-11 22:54:29 +01:00
Jeroen Akkerman
9a2e12a4e9 Update dependencies 2020-11-11 22:52:34 +01:00
Jeroen Akkerman
e087158074
Merge pull request #267 from nhymxu/patch-1
Allow modify lineNumbers via config options
2020-11-11 22:49:21 +01:00
Jeroen Akkerman
b06d1fe67f Add documentation and typings 2020-11-11 22:41:49 +01:00
Dung Nguyen
65186e4537
Allow modify lineNumbers via config options 2020-11-11 21:48:53 +07:00
Jeroen Akkerman
11f805f0b5 Fix CSS scoping issues (#252) 2020-10-30 13:29:42 +01:00
Jeroen Akkerman
21d51a053b Updated dependencies 2020-10-30 13:24:18 +01:00
Jeroen Akkerman
f65d2a7cc9 Updated changelog for PR #249 2020-10-30 13:20:25 +01:00
Jeroen Akkerman
70f3512120
Merge pull request #249 from mbolli/codemirror-autorefresh
include codemirror autorefresh addon
2020-10-30 12:39:22 +01:00
Jeroen Akkerman
6d173d0024
Update CONTRIBUTING.md 2020-10-16 14:35:34 +02:00
dani
29d2c6c5be fix for undefined scrollbar style 2020-10-11 08:44:20 +02:00
Ivan Borshchov
0c9be85cd7 fix not option 2020-10-08 13:27:01 +03:00
Ivan Borshchov
edfeb87653 previewImagesInEditor doc improve 2020-10-08 12:20:26 +03:00
Ivan Borshchov
dba3201c79 fix cursor preceise positioning when content with images are loaded into editor, show preview only for images on separate lines (not inlines) 2020-10-08 12:19:11 +03:00
Jeroen Akkerman
23c17b88b4 2.12.1 2020-10-06 15:00:21 +02:00
Jeroen Akkerman
1e41667ec6 Update changelog for 2.12.1 2020-10-06 14:59:40 +02:00
Jeroen Akkerman
6e48fc293c Set previewImagesInEditor option to false by default
Fixes #251
2020-10-06 14:52:54 +02:00
Daniel Calbet
c696922fe1 changelog: include new scrollbarStyle option 2020-10-04 06:55:35 +00:00
Daniel Calbet
3517348ef7 scrollbar style in options type 2020-10-04 06:39:01 +00:00
Daniel Calbet
eabb23fd3e using scrollbarStyle option 2020-10-02 09:25:13 +00:00
Michael Bolli
206f02272b changelog: include new autoRefresh option 2020-10-02 11:16:38 +02:00
Michael Bolli
c780d5af38 include codemirror autorefresh addon 2020-10-02 10:45:53 +02:00
Jeroen Akkerman
3e8830de82 2.12.0 2020-09-29 22:38:25 +02:00
Jeroen Akkerman
c94ea5301c Add missing type for previewImagesInEditor 2020-09-29 22:38:22 +02:00
Jeroen Akkerman
b86cd5ba01 Update changelog for 2.12.0 2020-09-29 22:33:06 +02:00
Jeroen Akkerman
14a5029306
Merge pull request #244 from czynskee/cm_overlay_mode_param
Cm overlay mode param
2020-09-29 22:13:52 +02:00
Jeroen Akkerman
dc6074d535 Merge branch 'master' into cm_overlay_mode_param 2020-09-29 22:07:25 +02:00
Jeroen Akkerman
3c99ac805e Update dependencies, closes #246 2020-09-29 21:51:12 +02:00
Jeroen Akkerman
5dc8bd5248 Add some static methods to typing tests 2020-09-29 21:47:34 +02:00
czynskee
eac3f519fb Update readme with overlayMode options. 2020-09-16 12:48:52 -07:00
czynskee
4ce74e904b Added option to supply an additional code-mirror overlay mode 2020-09-16 12:31:35 -07:00
Jeroen Akkerman
00215ecaeb
Merge pull request #242 from dalboris/better-size-units-2
Change default size units from 'b,Kb,Mb' to ' B, kB, MB' (#239)
2020-09-14 17:40:07 +02:00
Boris Dalstein
418116c1cc Change default size units from 'b,Kb,Mb' to ' B, kB, MB' (#239) 2020-09-14 17:21:51 +02:00
Jeroen Akkerman
7b90f83ae9
Merge pull request #235 from devforth/master
Add images preview in edit mode plus add keydown cleanup
2020-09-10 16:40:47 +02:00
Ivan Borshchov
2745b03b71 move line to another section ,rollback unneded change 2020-09-10 13:32:56 +03:00
Ivan Borshchov
2c793ee418 Add images preview in edit mode plus add keydown cleanup 2020-09-10 11:30:09 +03:00
Jeroen Akkerman
b461979067 Add missing drawUploadedImage export 2020-08-16 19:31:00 +02:00
Jeroen Akkerman
4796a2f5b6
Merge pull request #222 from nick-denry/fix_maxHeight_less_than_minHeight
Fix max height less than min height
2020-08-15 20:19:19 +02:00
Jeroen Akkerman
b9b19bb5ff
Merge pull request #225 from JoshuaLicense/pass-context-to-custom-image-upload-function
Pass the MDE context to the custom image function
2020-08-11 12:38:19 +02:00
Jeroen Akkerman
45e409b85e
Merge pull request #224 from JoshuaLicense/fix-image-upload-without-status-bar
Fix calls to updateStatusBar when the status bar is hidden
2020-08-10 16:58:45 +02:00
Jeroen Akkerman
5a5bb97a20
Merge pull request #223 from nick-denry/fix_to_textarea
Fix toTextArea issue
2020-08-10 16:43:45 +02:00
Nick Denry
8b177f9c05 KISS fix 2020-08-09 17:45:49 +03:00
Joshua License
0fc64ff7f9 Pass the MDE context to the image function
Removes the need to bind the context manually when wanting to access the class methods.
2020-08-08 11:05:56 +01:00
Joshua License
11d210545b Early exit from updateStatusBar if no status bar is available 2020-08-08 09:18:18 +01:00
Nick Denry
55312d8ec3
Fix toTextArea issue
Solves https://github.com/Ionaru/easy-markdown-editor/issues/217
2020-08-08 00:22:06 +03:00
Nick Denry
065a022644 Fix comment 2020-08-07 23:46:51 +03:00
Nick Denry
32e0971483 Fix maxHeight less than minHeight 2020-08-07 23:41:56 +03:00
Jeroen Akkerman
754bdc3ab2 Add missing changelog link 2020-07-16 18:47:20 +02:00
Jeroen Akkerman
78c3b6fa28 Fix changelog link 2020-07-16 18:46:39 +02:00
Jeroen Akkerman
c8630d6840 2.11.0 2020-07-16 18:45:15 +02:00
Jeroen Akkerman
87182dda65 Update changelog for 2.11.0 2020-07-16 18:45:02 +02:00
Jeroen Akkerman
3af0a9f5f3 Update dependencies 2020-07-16 18:42:53 +02:00
Jeroen Akkerman
531a0e6227
Merge pull request #204 from firm1/fix_181
forget debug options
2020-06-11 17:15:20 +02:00
firm1
3b831f87a4 forget debug options 2020-06-11 17:09:09 +02:00
Jeroen Akkerman
8212d4901a
Merge pull request #182 from firm1/fix_181
fix #181 : allow saving only on change content
2020-06-11 12:57:44 +02:00
Jeroen Akkerman
86d6ce7c6a
Merge pull request #203 from cornerman/highlightjs
adhere to language ascription in highlightjs
2020-06-11 12:52:28 +02:00
johannes karoff
36d9b238cf adhere to language ascription in highlightjs 2020-06-11 12:29:33 +02:00
firm1
5db44ab734 better debounce 2020-06-08 11:20:46 +02:00
firm1
825c65e204 not an option but a bugfix 2020-06-08 11:20:46 +02:00
firm1
450bead2d1 fix #181 : allow saving only on change content 2020-06-08 11:19:52 +02:00
Jeroen Akkerman
9dbb1dbe8a
Merge pull request #201 from nick-denry/describe_maxheight_option
Describe maxHeight option
2020-06-03 22:18:48 +02:00
Nick Denry
b23ff6675d Use undefined instead of false 2020-06-03 22:45:59 +03:00
Nick Denry
04ed77f829 KISS fix 2020-06-03 22:09:01 +03:00
Nick Denry
2bd4b289b3 maxHeight option typings 2020-06-03 17:30:13 +03:00
Nick Denry
d339c6af97 Describe maxHeight option 2020-06-03 17:15:06 +03:00
Jeroen Akkerman
d90085acb5
Merge pull request #196 from nick-denry/preview_without_fullscreen
Preview without fullscreen
2020-06-03 13:40:09 +02:00
Jeroen Akkerman
711d62cd8f Fix whitespace character in readme 2020-06-03 13:00:55 +02:00
Jeroen Akkerman
8fa73cf079 Add new option to documentation and typings 2020-06-03 12:55:27 +02:00
Jeroen Akkerman
4a6119daaf Add contribution to changelog 2020-06-03 12:52:28 +02:00
Nick Denry
57788bd392 Code style 2020-06-03 00:59:02 +03:00
Nick Denry
82c447cf85 Remove bottom rigth radius for CM-sided 2020-06-03 00:45:28 +03:00
Nick Denry
f72d590332 Semantic fix 2020-06-02 16:05:45 +03:00
Nick Denry
4862def4a4 Toggle sideBySide first due to classes set properly 2020-06-01 16:16:40 +03:00
Nick Denry
d4cbe44fa4 Set preview height after element is added 2020-06-01 16:15:18 +03:00
Nick Denry
f3b1090e53 Adjust sideBySide with no fullscreen and maxHeight option 2020-06-01 15:44:57 +03:00
Nick Denry
f85afc44e1 Code style 2020-05-29 17:42:07 +03:00
Nick Denry
1fd1ee2a97 Deal with minHeight option 2020-05-29 03:15:56 +03:00
Nick Denry
a61c7198a3 Extra border fix 2020-05-29 01:59:22 +03:00
Nick Denry
b7093dabc3 Preview without fullscreen 2020-05-29 01:53:15 +03:00
Jeroen Akkerman
41fef9ae3e Update dependencies 2020-05-09 01:16:24 +02:00
Jeroen Akkerman
454ebc6fb6 Add support for Node.js 14 2020-05-09 01:14:50 +02:00
Jeroen Akkerman
890c72589e Fix checkboxes always have bullets in front of them
Fixes #136
2020-05-09 01:14:41 +02:00
Jeroen Akkerman
df3d6511c8
Merge pull request #180 from A-312/no-previous-function
Add `toolbar` variable instead `wrapper.previousSibling`
2020-04-27 15:43:31 +02:00
Jeroen Akkerman
b1d29c491f
Merge pull request #184 from firm1/fix_183
Fix refresh display cursor position
2020-04-20 15:12:49 +02:00
firm1
64705178ab changelog 2020-04-15 15:12:11 +02:00
firm1
24d4cc87af fix #183 : refresh cursor position on activity 2020-04-15 15:10:59 +02:00
A-312
3150f71342 Add toolbar variable instead wrapper.previousSibling
In my project we customize Easymde and add div between toolbar and wrapper, this break fullscreen feature.
2020-04-10 22:34:10 +02:00
Jeroen Akkerman
228fe91a72 2.10.1 2020-04-06 14:09:36 +02:00
Jeroen Akkerman
546c09da5b Update changelog for 2.10.1 2020-04-06 14:09:30 +02:00
Jeroen Akkerman
cc65563714 Fixed typescript error when entering certain strings for toolbar buttons
Closes #178
2020-04-06 14:07:24 +02:00
Jeroen Akkerman
bcb1f7dfbd 2.10.0 2020-04-02 12:15:12 +02:00
Jeroen Akkerman
d628896c91 Update changelog for 2.10.0 2020-04-02 12:15:01 +02:00
Jeroen Akkerman
ad439d157a Update dependencies 2020-04-02 12:11:14 +02:00
Jeroen Akkerman
9f15b0e50f Merge branch 'master' into changelog 2020-04-02 12:09:10 +02:00
Jeroen Akkerman
c6f99edf46
Merge pull request #176 from StefKors/update-marked-to-0.8.2
Update Marked dependency to 0.8.2
2020-04-01 08:38:07 -07:00
StefKors
6711900d72 update Marked dependency to 0.8.2
Change-type: patch
Signed-off-by: Stef Kors <stef@balena.io>
2020-03-30 12:14:19 +02:00
Jeroen Akkerman
7033a1f2a7 Add most recently merged PR (#175) to changelog 2020-03-26 13:48:35 +01:00
Jeroen Akkerman
8d7ba010a9
Merge pull request #175 from StefKors/fix-z-index
Set .CodeMirror z-index to 0
2020-03-26 13:45:19 +01:00
StefKors
eec7559aaa Set base z-index to 0 2020-03-25 17:15:51 +01:00
Jeroen Akkerman
6470e10e29
Merge pull request #168 from kolaente/feature/137-custom-icons
Add support for custom icon markup
2020-03-24 15:55:16 +01:00
kolaente
de1f32bd1f
Fix icon class handling if no custom icon classes are provided 2020-03-23 18:18:04 +01:00
kolaente
cc0706bfc2
Also still add custom classes when using custom icon markup 2020-03-23 18:07:52 +01:00
kolaente
85e59747ab
Merge branch 'master' into feature/137-custom-icons 2020-03-23 17:48:29 +01:00
Jeroen Akkerman
39f9cd7813
Merge pull request #173 from A-312/update5.52.2
Updated codemirror to version 5.52.2
2020-03-21 23:22:08 +01:00
A-312
03ba544095
Update CHANGELOG.md (Add Thanks)
Co-Authored-By: Situphen <Situphen@users.noreply.github.com>
2020-03-21 13:06:27 +01:00
A-312
753bed4772 Update package-lock.json 2020-03-21 12:08:59 +01:00
A-312
693db8bf17 Updated codemirror to version 5.52.2 (fix:#160) 2020-03-21 11:47:05 +01:00
Jeroen Akkerman
4a1e6de4de Add typings for options added in PR #170 2020-03-20 14:35:24 +01:00
Jeroen Akkerman
cca5c07346 Add most recently merged PR (#169) to changelog 2020-03-20 14:24:14 +01:00
Jeroen Akkerman
d4f0e73384 Merge remote-tracking branch 'origin/master' 2020-03-20 14:18:44 +01:00
Jeroen Akkerman
f69b3c37fc
Merge pull request #169 from felipefdl/master
bugfix for IE compatibility, thanks to markedjs/marked#1585 (comment)
2020-03-20 14:17:19 +01:00
Jeroen Akkerman
2e7f2546a2 Add missing links to changelog 2020-03-20 13:55:22 +01:00
Jeroen Akkerman
0d178d4dd1 Update dependencies 2020-03-20 13:49:42 +01:00
Jeroen Akkerman
4e5e1c43a6 Add most recently merged PR (#170) to changelog 2020-03-20 13:47:43 +01:00
Jeroen Akkerman
a42bcddc2f
Merge pull request #170 from dima-bzz/autosave
Added time format and text for autosave
2020-03-20 13:11:32 +01:00
Dmitry Mazurov
1e64cba17e Added DateTimeFormat support for autosave.
Signed-off-by: Dmitry Mazurov <dimabzz@gmail.com>
2020-03-19 12:17:40 +03:00
dima-bzz
8a1e2e5d5b
Update Readme 2020-03-18 14:48:23 +03:00
Dmitry Mazurov
7706de0a2b Update Readme
Signed-off-by: Dmitry Mazurov <dimabzz@gmail.com>
2020-03-18 14:45:10 +03:00
Dmitry Mazurov
ad83e77aee Added option time format for autosave (12/24). Added option text for autosave. 2020-03-18 14:39:46 +03:00
Felipe Lima
afa35b9e65 bugfix for IE compatibility, thanks to markedjs/marked#1585 (comment) 2020-03-16 11:15:59 -03:00
kolaente
9a20111767
Remove unused empty line 2020-03-14 22:26:42 +01:00
kolaente
a12ba4790a
Add support for custom icon markup 2020-03-14 22:18:23 +01:00
Jeroen Akkerman
3096bbe291
Merge pull request #141 from firm1/dropdown
feat : allow dropdown menu on toolbar to group secondary buttons
2020-03-08 13:22:40 +01:00
Jeroen Akkerman
b85bdde0ed Add button shortcuts and typings 2020-03-06 01:17:33 +01:00
Jeroen Akkerman
8c01edd7cd Merge branch 'master' into dropdown 2020-03-06 00:52:20 +01:00
Jeroen Akkerman
fc81bd476c Add sanitizerFunction to typings 2020-03-06 00:43:08 +01:00
Jeroen Akkerman
84ea2c2cca
Merge pull request #147 from adamb70/sanitize-deprecation
Allow custom sanitize function
2020-03-06 00:37:29 +01:00
Jeroen Akkerman
012b66d982
Merge pull request #120 from jecsham/dev-feature-example
Added example directory with default demo file
2020-03-06 00:35:50 +01:00
Jeroen Akkerman
da6a6c81f1
Merge branch 'master' into sanitize-deprecation 2020-03-06 00:34:36 +01:00
Jeroen Akkerman
0306c9a2e5
Merge pull request #150 from A-312/improve-gulp
Add `watch` command (instead build after each change)
2020-03-06 00:34:07 +01:00
A-312
67ba044b5c Watch all js files 2020-03-05 18:34:24 +01:00
Jeroen Akkerman
0fe3eb15b9
Merge branch 'master' into sanitize-deprecation 2020-03-04 20:33:01 +01:00
Jecsham
1f681e527c
Merge branch 'master' into dev-feature-example 2020-03-03 18:00:31 -05:00
A-312
23a06e46a3 Add watch command (instead build after each change) 2020-03-01 17:49:17 +01:00
Jeroen Akkerman
2a1209da26 Update dependencies 2020-02-18 00:29:56 +01:00
adamb70
f8434d7a4b Update CHANGELOG.md 2020-02-06 12:36:30 +00:00
adamb70
05fad19787
Merge branch 'master' into sanitize-deprecation 2020-02-06 10:43:36 +00:00
Jecsham
e7afb10ed9
Merge branch 'master' into dev-feature-example 2020-02-05 20:33:46 -05:00
Jeroen Akkerman
ab8923096b
Merge pull request #148 from craigteegarden/patch-1
fix link in changelog
2020-02-05 21:42:32 +01:00
Craig Teegarden
d0bc3b7e85
fix link in changelog 2020-02-05 15:34:22 -05:00
Jecsham
83635a30ee
Merge branch 'master' into dev-feature-example 2020-02-04 22:06:12 -05:00
adamb70
c83c593d58 Use .call() on the sanitize function 2020-02-04 18:21:54 +00:00
adamb70
9d2665b895 Allow custom sanitize function
Update README.md
2020-02-04 13:46:56 +00:00
firm1
b11cd8edb0 don't use down icon 2020-01-28 21:35:28 +01:00
firm1
26d2da9e29 @Ionaru 's review : disable actions on top of dropdown, add dropdown icon and open on clic 2020-01-28 18:55:25 +01:00
firm1
6f4225ccb2 update changelog. 2020-01-28 18:55:25 +01:00
firm1
eea2917be1 @situphen 's review 2020-01-28 18:54:35 +01:00
firm1
98fbe56248 allow dropdown menu on toolbar to group secondary buttons 2020-01-28 18:54:35 +01:00
Jeroen Akkerman
661fcc82ab Fix name link in changelog 2020-01-27 10:57:52 +01:00
Jeroen Akkerman
0be4e6ac62 Fix links in changelog 2020-01-27 10:34:37 +01:00
Jeroen Akkerman
95b177e25c Add typings for features added in #143 and #139 2020-01-27 10:30:31 +01:00
Jeroen Akkerman
bb3c5cd539
Merge pull request #143 from firm1/allow-options
add two options inputStyle and nativeSpellcheck
2020-01-26 22:34:01 +01:00
firm1
1bb6f6dd0d typo 2020-01-26 21:25:52 +01:00
firm1
9ab45526a1 Merge remote-tracking branch 'origin/allow-options' into allow-options
# Conflicts:
#	CHANGELOG.md
2020-01-26 20:28:08 +01:00
firm1
b6301f3976 update Changelog and @situphen 's review ! 2020-01-26 20:26:32 +01:00
Jeroen Akkerman
f319bc3096 Merge branch 'master' into allow-options 2020-01-26 00:05:09 +01:00
Jeroen Akkerman
9b9edec517
Merge pull request #139 from Situphen/delay
Differentiate between regular autosave delay and submit autosave delay
2020-01-25 23:41:57 +01:00
Jeroen Akkerman
b4eca2a3d6 Add name to changelog and add non-breaking option 2020-01-25 23:36:13 +01:00
firm1
4245da6eae add two options inputStyle and nativeSpellcheck 2020-01-25 03:43:44 +01:00
Situphen
0dc4c2697e Differentiate between regular autosave delay and submit autosave delay 2020-01-20 21:44:16 +01:00
Jeroen Akkerman
c12761a42a 2.9.0 2020-01-13 22:33:22 +01:00
Jeroen Akkerman
a53ff1eeef Drop Node.js 6 testing 2020-01-13 22:31:24 +01:00
Jeroen Akkerman
eef443f837 Update changelog for 2.9.0 2020-01-13 22:29:05 +01:00
Jeroen Akkerman
187b1b147d Update dependencies 2020-01-13 22:26:35 +01:00
Jeroen Akkerman
17c0987281 Add changelog entry for PR #132 2020-01-13 22:17:13 +01:00
Jeroen Akkerman
c39b521cb3
Merge pull request #132 from Situphen/localstorage
Remove empty localStorage entries
2020-01-13 22:09:04 +01:00
Situphen
ef213175ce Remove empty localStorage entries 2020-01-12 13:25:23 +01:00
Jeroen Akkerman
a49da28f4d Update dependencies 2019-11-04 16:42:49 +01:00
Jeroen Akkerman
e9e5bef137 Add missing configuration options
Fixes #126
2019-11-03 17:11:41 +01:00
Jeroen Akkerman
d4a78e1a43
Merge pull request #123 from t49tran/feat-add-missing-prop-types
feat: add missing minHeight attribute to Option interface
2019-10-25 10:12:15 +02:00
Duong Tran
61937dd5ac test: add minHeight to easymde-test 2019-10-19 16:00:18 +11:00
Duong Tran
8436f67dfb feat: add missing minHeight attribute to Option interface 2019-10-16 23:20:50 +11:00
jecsham
72be232395 dev-feature: added example directory with default demo 2019-09-12 20:48:21 -05:00
Jeroen Akkerman
94750c8327
Merge pull request #115 from Ionaru/dependabot/npm_and_yarn/eslint-utils-1.4.2
Bump eslint-utils from 1.4.0 to 1.4.2
2019-08-26 20:37:51 +02:00
dependabot[bot]
2a04d42fb2
Bump eslint-utils from 1.4.0 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-26 17:18:58 +00:00
Jeroen Akkerman
375ea8026c 2.8.0 2019-08-20 01:10:55 +02:00
Jeroen Akkerman
4032f10999 Updated changelog for 2.8.0 2019-08-20 01:10:39 +02:00
Jeroen Akkerman
981b63cacc Fixed missing link in dist file header 2019-08-20 01:10:31 +02:00
Jeroen Akkerman
7fa4521145 Updated dependencies 2019-08-20 01:05:09 +02:00
Jeroen Akkerman
8fa457e5c6
Merge pull request #97 from getselfstudy/master
Allow html to stay on preview page to make it easier to use with react.
2019-08-20 00:55:45 +02:00
Jeroen Akkerman
aa01768e5e Updated changelog for PR #97 2019-08-20 00:51:44 +02:00
Jeroen Akkerman
815a9ce759 Removed dist files 2019-08-20 00:39:33 +02:00
Jeroen Akkerman
d5d99e166e Merge branch 'master' into html_stay 2019-08-20 00:38:20 +02:00
Jeroen Akkerman
d114dab8a3
Merge pull request #109 from jfly/upload-polish
Upload polish
2019-08-20 00:31:10 +02:00
Jeroen Akkerman
78b2083c9e Updated changelog for PR #109 2019-08-20 00:26:27 +02:00
Jeremy Fleischman
8a2283cf27
Bail out if there are no files to upload.
Without this change, if you either:
  - Click and drag some text into the markdown editor, or
  - Copy paste some text into the markdown editor

The status bar will get updated to say "Uploading image ...", and will
never stop.
2019-07-29 02:54:20 -07:00
Jeremy Fleischman
efb840c633
Fix openBrowseFileWindow to also obey self.options.imageUploadFunction if specified.
I think this part just got missed in
https://github.com/Ionaru/easy-markdown-editor/pull/106.

I'm not sure if I should be doing anything with the `onSuccess` and
`onError` callbacks here.
2019-07-29 02:49:36 -07:00
Jeroen Akkerman
02d6653cc5 Updated changelog for PR #106 2019-07-24 14:58:19 +02:00
Jeroen Akkerman
eb59b22491
Allow custom upload function (#106)
Allow custom upload function

Co-authored-by: Jeroen Akkerman <Jeroen_akkerman1@hotmail.com>
2019-07-24 14:53:27 +02:00
Jeroen Akkerman
509763f3b2 Stricter typings for the onSuccess and onError calls 2019-07-24 14:26:11 +02:00
Sebastián Pérez Pérez
0a5b0d3ac4 Allow custom upload function 2019-07-23 13:35:49 +01:00
dependabot[bot]
a8ee1c7281 Bump lodash.template from 4.4.0 to 4.5.0
Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-19 15:01:10 +02:00
Jeroen Akkerman
ad862a6816
Upload images functionality update (#101)
Upload images functionality update

Co-authored-by: Nathanaël <njourdane@irap.omp.eu>
Co-authored-by: Jeroen Akkerman <Jeroen_akkerman1@hotmail.com>
2019-07-19 12:51:54 +02:00
Jeroen Akkerman
63a1825b6e Log errors to console.error 2019-07-18 14:46:08 +02:00
Jeroen Akkerman
0558fb0d68 Increase timeout of error message to 10s 2019-07-18 14:29:54 +02:00
Jeroen Akkerman
cd7c9b8d4d Fixed errorMessages 2019-07-18 12:56:51 +02:00
Jeroen Akkerman
65af615c9b This PR will close #46 (super small edit to make that comment) 2019-07-18 12:43:10 +02:00
Jeroen Akkerman
11963829fc Added typings for image upload 2019-07-18 12:35:14 +02:00
Jeroen Akkerman
917ea336c4 Pre-calculate max file size 2019-07-18 12:01:50 +02:00
Jeroen Akkerman
f1b6a42561 Auto-format of the code 2019-07-18 12:00:32 +02:00
Jeroen Akkerman
6c66b54e2a Improve status bar logic 2019-07-18 11:45:39 +02:00
Jeroen Akkerman
d607dc4a15 Merge branch 'master' into upload_images_2 2019-07-18 11:31:46 +02:00
Jeroen van Oorschot
5f56c27ba7 update changelog 2019-07-16 11:01:05 +02:00
Jeroen van Oorschot
4f581b0c31 Show error message in status bar and reset status bar afterwards. 2019-07-15 22:29:11 +02:00
Jeroen van Oorschot
d9ee9c43d3 Allow server side error messages. 2019-07-15 22:04:02 +02:00
Jeroen van Oorschot
29d145a9b1 Add option for CSRF token on AJAX image upload 2019-07-15 21:39:49 +02:00
Jeroen van Oorschot
c54168a656 Fix status bar. 2019-07-15 15:52:43 +02:00
Jeroen van Oorschot
bbf3340581 IE11 compat. Fix status bar. 2019-07-15 15:11:07 +02:00
Jeroen van Oorschot
d317873fb0 update auxilary files and readme with 2.7.0 2019-07-15 13:24:58 +02:00
Jeroen van Oorschot
ff0db2000a Merge with 2.7.0. 2019-07-15 11:37:22 +02:00
Jeroen Akkerman
23cfe89fa0 Run typescript tests automatically 2019-07-13 19:22:16 +02:00
Jeroen Akkerman
66dcf7d868 2.7.0 2019-07-13 19:22:16 +02:00
Jeroen Akkerman
41e9d9a806 Updated changelog for 2.7.0 2019-07-13 19:22:12 +02:00
Jeroen Akkerman
a919391e34
Merge pull request #100 from Ionaru/custom-preview-class
Added option to override the preview screen styling, closes #99
2019-07-13 17:40:01 +02:00
Jeroen Akkerman
7cfeb37257 Added typings for new option 2019-07-12 14:36:59 +02:00
Jeroen Akkerman
71170a7eef Updated changelog for previewClass feature, closes #99 2019-07-12 14:10:56 +02:00
Jeroen Akkerman
5ffeba5a3c Added option to override the preview screen styling 2019-07-12 14:00:23 +02:00
Jeroen Akkerman
073bfbcea5 Updated dependencies and made code comply with new eslint rules 2019-07-11 10:19:42 +02:00
Jeroen Akkerman
912fd584ba
Bump lodash.template from 4.4.0 to 4.5.0 (#98)
Bump lodash.template from 4.4.0 to 4.5.0

Co-authored-by: null <49699333+dependabot[bot]@users.noreply.github.com>
2019-07-11 09:54:31 +02:00
dependabot[bot]
83c18f4971
Bump lodash.template from 4.4.0 to 4.5.0
Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-11 02:31:16 +00:00
Andreas Richter
16b6f732d3 Allow deployment from git by adding dist folder. 2019-06-26 11:17:37 -04:00
Andreas Richter
f831662fdd Allow html to stay on preview page. 2019-06-26 11:06:00 -04:00
Jeroen Akkerman
786c5b63c6 Fixed version link in changelog 2019-06-17 15:16:32 +02:00
Jeroen Akkerman
17b3fe7b4f 2.6.1 2019-06-17 15:14:06 +02:00
Jeroen Akkerman
11d533cb16 Updated changelog for 2.6.1 2019-06-17 15:13:51 +02:00
Jeroen Akkerman
672291381d Added .npmrc to disable git tag prefix 2019-06-17 15:12:59 +02:00
Jeroen Akkerman
2ca09829b1 Updated changelog for PR #93 2019-06-17 15:07:54 +02:00
Jeroen Akkerman
c429efaff1 Merge branch 'master' of https://github.com/Ionaru/easy-markdown-editor 2019-06-17 15:04:17 +02:00
Jeroen Akkerman
1e9e4e46e0
fix: untoggle ordered-list items first when toggling unordered-list items (#93)
fix: untoggle ordered-list items first when toggling unordered-list items
Fixes #92
2019-06-17 13:02:43 +00:00
Jeroen Akkerman
6b85628042 Use Terser for JS minification instead of (deprecated) UglifyJS 2019-06-17 14:54:29 +02:00
roryok
58f26bc82c reset package-lock changes 2019-06-17 13:26:48 +01:00
roryok
c75a5edc1e remove console logging 2019-06-17 13:26:18 +01:00
roryok
8c443bf401 fix: untoggle ordered-list items first when toggling unordered-list items 2019-06-17 13:23:57 +01:00
Jeroen Akkerman
bd7c2595e8 Rewrite travis config to use job stages 2019-06-02 21:29:15 +02:00
Jeroen Akkerman
23d6aa738d Add Node.js 12 to Travis 2019-06-02 21:26:55 +02:00
Jeroen Akkerman
b529d9a28b Updated dependencies 2019-06-02 21:23:18 +02:00
Jeroen Akkerman
aa0304fdaa Merge branch 'pull-75' 2019-04-15 15:44:42 +02:00
Jeroen Akkerman
8b5806d663 Updated changelog for PR #75 2019-04-15 15:43:25 +02:00
Jeroen Akkerman
8e46c9f3c9
Merge pull request #75 from ysykzheng/master
fix custom action shortcut not working
2019-04-15 15:42:06 +02:00
Jeroen Akkerman
cc0c211759 Fixed shortcut code so links are opened as well. 2019-04-15 15:20:48 +02:00
Jeroen Akkerman
2a0def5fb5 Merge branch 'master' into pull-75 2019-04-15 15:15:17 +02:00
Jeroen Akkerman
aa7ea0b762 2.6.0 2019-04-15 12:58:18 +02:00
Jeroen Akkerman
5882c03933 Updated changelog for 2.6.0 2019-04-15 12:58:06 +02:00
Jeroen Akkerman
8f7d4dcb11 Simplify links in package.json 2019-04-15 12:55:51 +02:00
ysykzheng
98ab3513a6
Merge branch 'master' into master 2019-04-15 17:52:50 +08:00
Jeroen Akkerman
11de338c25
Merge pull request #81 from xmikasax/marked-merge-request
Update marked dependency. DOS vulnerability was patched in 0.6.2
2019-04-10 21:51:37 +02:00
xmikasax
d50378970a Update marked dependency. DOS vulnerability was patched in 0.6.2 2019-04-10 21:56:02 +03:00
ysykzheng
9e94709192 fix custom action shortcut not working 2019-03-26 23:36:17 +08:00
ysykzheng
8f590f4f96
Merge pull request #1 from Ionaru/master
update
2019-03-26 22:15:31 +08:00
Nathanaël Jourdane
4ae7fc8bc9 Allow openBrowseFileWindow() external call with custom callback 2019-03-13 18:48:36 +01:00
Nathanaël Jourdane
780845b7b2 Merge master into upload_images 2019-03-12 16:08:09 +01:00
Nathanaël Jourdane
6e35026a75 [wip upload-image] bugfix error message displayed twice 2019-03-12 16:07:55 +01:00
Nathanaël Jourdane
4ac86cc49d [wip upload-image] use more generic error codes, so the server could be used to upload other files than images 2019-03-12 16:07:55 +01:00
Jeroen Akkerman
fb1ce409bb Did not mean to commit that test.html file 2019-03-12 16:07:55 +01:00
Jeroen Akkerman
50fb9a9a3f Version 2.2.1 wasn't yanked 2019-03-12 16:07:55 +01:00
Jeroen Akkerman
17f5d064a2 Added links to users, issues and PRs to changelog 2019-03-12 16:07:55 +01:00
Nathanaël Jourdane
5fa549d3b3 [wip upload-image] make onError optionnal 2019-03-11 18:17:29 +01:00
Nathanaël Jourdane
8eff45f7a0 [wip upload-image] image server is now supposed to return a json object 2019-03-11 17:19:27 +01:00
Jeroen Akkerman
77038e4883 Did not mean to commit that test.html file 2019-03-08 18:10:46 +01:00
Jeroen Akkerman
6d5716f7c3 Version 2.2.1 wasn't yanked 2019-03-08 18:08:25 +01:00
Jeroen Akkerman
24d6cfb159 Added links to users, issues and PRs to changelog 2019-03-08 15:11:17 +01:00
roipoussiere
6c8ce85ea9 Add errorCallback option 2019-03-07 20:41:45 +01:00
Nathanaël
293c402e7d
Merge branch 'master' into upload_images 2019-03-07 18:20:23 +01:00
Nathanaël Jourdane
d374c5faec [wip upload-image] Better errors support and small code improvements 2019-03-07 18:15:59 +01:00
Jeroen Akkerman
c98bb016ff Fixed headers in the changelog being too big. 2019-03-07 13:43:50 +01:00
Jeroen Akkerman
087bc8cfed Added standardized changelog file. 2019-03-07 13:42:09 +01:00
Nathanaël Jourdane
9f33099b1c Use textContent instead innerHTML when appropriate to avoid XSS 2019-03-07 11:31:48 +01:00
Nathanaël Jourdane
effc080bae [wip upload-image] Allow image upload with copy-paste 2019-03-06 15:36:58 +01:00
Nathanaël Jourdane
fa2c299455 [wip upload-image] Refactoring: remove createImageInput(), set uploadImage() as a prototype, create uploadImages() 2019-03-06 15:35:52 +01:00
Nathanaël Jourdane
ad31ea565c [wip upload-image] Display status messages about image upload in status bar. 2019-03-05 18:08:33 +01:00
Nathanaël Jourdane
3cb4a817f2 [wip upload-image] Allow image upload with drag&drop 2019-03-05 11:44:31 +01:00
Nathanaël Jourdane
e1536da530 [wip upload-image] bugfix error popup 2019-03-05 10:08:01 +01:00
Nathanaël
c7275aa72b
Merge branch 'master' into upload_images 2019-03-05 07:51:29 +01:00
Jeroen Akkerman
e1ae0e4230
Create issue templates 2019-03-05 00:58:57 +01:00
Jeroen Akkerman
8f435686d7
Merge pull request #70 from roipoussiere/fix_markdown_help_link
Update markdown guide link in readme
2019-03-04 22:13:48 +01:00
Nathanaël Jourdane
070e3e5c83 [wip upload-image] update readme with new upload-image options 2019-03-04 18:12:54 +01:00
Nathanaël Jourdane
aa39672e4e [wip upload-image] After image upload, insert image markdown template with uploaded image url 2019-03-04 18:10:46 +01:00
Nathanaël Jourdane
3d1e33396f [wip upload-image] Upload image when selecting it on browse-file window 2019-03-04 18:07:59 +01:00
Jeroen Akkerman
dd0e96b204 Improve icon class regex 2019-03-04 17:46:15 +01:00
Nathanaël Jourdane
11e613b3d5 [wip upload-image] Add image icon to open the browse-file window 2019-03-04 17:05:22 +01:00
Jeroen Akkerman
14bfa678ab
Merge pull request #58 from Ionaru/bugfix/simplemde-compatibility
Restore backwards compatibility with SimpleMDE
2019-03-04 15:56:07 +01:00
Jeroen Akkerman
b14d7dda1c Merge branch 'master' into bugfix/simplemde-compatibility 2019-03-04 15:43:47 +01:00
roipoussiere
526f2ec82a Update markdown guide link in readme 2019-02-28 22:41:02 +01:00
Jeroen Akkerman
07d96c3842
Merge pull request #69 from roipoussiere/comma_dangle
Set eslint rule comma-dangle to always-multiline and apply it
2019-02-28 18:03:59 +01:00
Nathanaël Jourdane
dec5ca1148 Set eslint rule comma-dangle to always-multiline and apply it 2019-02-28 17:29:06 +01:00
Jeroen Akkerman
c81e7466fd
Merge pull request #63 from roipoussiere/fix_link
Fix marked option link in readme
2019-02-28 16:22:23 +01:00
Jeroen Akkerman
1158ef13aa
Merge pull request #62 from roipoussiere/prompt_with_https
Fill image and link prompts to 'https://' by default
2019-02-28 16:22:07 +01:00
Nathanaël Jourdane
7c0c530995 Merge master into fix_link 2019-02-28 16:13:15 +01:00
Jeroen Akkerman
bbe78803b0 Only include necessary files in build package 2019-02-28 16:12:42 +01:00
Nathanaël Jourdane
d875d98b9c Ignore dist folder and remove it 2019-02-28 16:12:42 +01:00
Nathanaël Jourdane
96c8c228b5 merge master 2019-02-28 16:01:58 +01:00
Jeroen Akkerman
d95de92048
Merge pull request #67 from roipoussiere/no_dist
Ignore dist folder and remove it
2019-02-28 15:09:39 +01:00
Jeroen Akkerman
48ece14c95
Merge branch 'master' into no_dist 2019-02-28 15:06:01 +01:00
Jeroen Akkerman
a8306bf617 Only include necessary files in build package 2019-02-28 14:58:54 +01:00
Nathanaël Jourdane
b309645005 Ignore dist folder and remove it 2019-02-28 10:10:59 +01:00
Jeroen Akkerman
c0ea7aab25
Merge branch 'master' into fix_link 2019-02-27 23:49:07 +01:00
Nathanaël Jourdane
e2f4508ec2 Fix marked option link in readme 2019-02-27 17:31:01 +01:00
Nathanaël Jourdane
1c7ce2a0d4 Fill image and link prompts to 'https://' by default 2019-02-27 17:10:07 +01:00
Jeroen Akkerman
99f303229b Updated packages 2019-02-27 13:59:42 +01:00
Jeroen Akkerman
c1a695af51 Auto-format of types folder. 2019-02-27 13:54:57 +01:00
Jeroen Akkerman
df530cf465 Change markdown guide link to open-source Markdown guide website. 2019-02-27 13:54:27 +01:00
Jeroen Akkerman
0baa96af59 Only show build status of the master branch 2019-02-27 11:07:32 +01:00
Jeroen Akkerman
4556f4f1d3 Added latin extensions to wordCount pattern, fixes #61. 2019-02-27 11:06:59 +01:00
Jeroen Akkerman
104e10b401 Fix small typos in CONTRIBUTING.md and remove old file. 2019-02-21 17:50:46 +01:00
Jeroen Akkerman
f50c96bc01 Small fixes for this change
* Removed redundant code.
* Renamed function to better reflect its behaviour.
* Marked `noDisable` and `noMobile` as optional.
2019-02-20 01:59:54 +01:00
Jeroen Akkerman
4385d733e5 Update packages and build dist files. 2019-02-20 01:42:48 +01:00
Jeroen Akkerman
fa9ff580c4 Restore backwards compatibility with SimpleMDE, fixes #41 2019-02-20 01:41:53 +01:00
Jeroen Akkerman
aa47cbd638 Change branch for build badge in README 2019-02-19 00:59:43 +01:00
Jeroen Akkerman
78c91a3977 Update npm key 2019-02-19 00:55:43 +01:00
Jeroen Akkerman
aa7a5f041d Rebuilt dist JS & don't use npx yet in travis.yml 2019-02-19 00:26:04 +01:00
Jeroen Akkerman
4bea687682 Remove old (and not working) CONTRIBUTING.md 2019-02-19 00:20:21 +01:00
Jeroen Akkerman
711ce62657 Adjust travis.yml for master-only repository. 2019-02-19 00:19:53 +01:00
Jeroen Akkerman
b9ee1db9be Merge branch 'development' 2019-02-19 00:13:34 +01:00
Jeroen Akkerman
cae45434b0
Merge pull request #54 from roipoussiere/readme_rework_dev
Readme rework
2019-02-18 11:27:47 +01:00
Nathanaël Jourdane
51498a3fe6 contributing.md: install node v10 instead of v8 2019-02-13 11:58:46 +01:00
Jeroen Akkerman
9c8c8dc0c2
fix bullets-points indentation in CONTRIBUTING.md
Co-Authored-By: roipoussiere <roipoussiere@protonmail.com>
2019-02-13 11:23:29 +01:00
Nathanaël Jourdane
99380d4fde Improve list rendering in PR steps 2019-02-13 09:40:47 +01:00
Nathanaël Jourdane
75ea30f3a1 typo 2019-02-12 14:05:54 +01:00
Nathanaël Jourdane
6f0740fedf Add hacking in readme TOC. 2019-02-12 14:04:35 +01:00
Nathanaël Jourdane
3437ced229 Add hacking instructions in readme and add minor changes in contribution guide. 2019-02-12 13:42:01 +01:00
Nathanaël Jourdane
c46ddde5e0 Add modifications suggested in code review 2019-02-11 17:13:12 +01:00
Nathanaël Jourdane
7f7554effd fix bullets on contribution guide 2019-02-11 15:24:55 +01:00
Nathanaël Jourdane
9fefb494ba Add contribution guide 2019-02-11 15:19:08 +01:00
Nathanaël Jourdane
2555bc0b24 Fix typos and other minor improvements. 2019-02-11 14:46:16 +01:00
Nathanaël Jourdane
e0e988d463 Add summary 2019-02-11 14:28:33 +01:00
Nathanaël Jourdane
a4a89775dc Improve titles structure 2019-02-11 14:26:05 +01:00
Nathanaël Jourdane
bb1279ed2f move badges to the top (quick access) 2019-02-11 14:15:18 +01:00
Nathanaël Jourdane
ab4ac71f5a Add license section 2019-02-11 14:13:26 +01:00
Nathanaël Jourdane
05cd00d36e Move fork explanation to the end of readme (better readability). 2019-02-11 14:12:36 +01:00
Jeroen Akkerman
b697af6254 README update
* Added more information about EasyMDE
* Replace most mentions of SimpleMDE with EasyMDE
2019-01-17 17:25:03 +01:00
Jeroen Akkerman
92e1425a4f Force dist js file override from hotfix 2019-01-17 12:33:23 +01:00
Jeroen Akkerman
9c779bf85c Merge branch 'hotfix/2.5.1' 2019-01-17 12:32:17 +01:00
Jeroen Akkerman
20cd3e4586 Hotfix: change role="button" to type="button"
* Closes issue #45 and properly fixes issue #38
* Added typescript support line to README
* Bumped version to 2.5.1
* Rebuilt dist files
2019-01-17 12:29:45 +01:00
Jeroen Akkerman
5abc4d7292 Package updates 2019-01-17 11:50:33 +01:00
Jeroen Akkerman
28c247279b Merge branch 'release/2.5.0' into development 2019-01-17 11:38:14 +01:00
Jeroen Akkerman
8c6ae58a6c Merge branch 'release/2.5.0' 2019-01-17 11:38:05 +01:00
Jeroen Akkerman
40303a5fc6 Prepare for release 2.5.0
* Bump version to 2.5.0
* Build files for distribution
2019-01-17 11:31:37 +01:00
Jeroen Akkerman
61b8aa2293
Merge pull request #44 from FranklinWhale/add-typings
Add typings
2019-01-17 11:17:19 +01:00
Jeroen Akkerman
5b01fba882 Added more tests for the types file. 2019-01-17 11:12:40 +01:00
Jeroen Akkerman
5a37a534dc Forgot npm run in the command, added. 2019-01-17 09:50:54 +01:00
Jeroen Akkerman
2ad0d26127 Automatic Travis tests & consistency
* Added `test:types` to travis run script.
* Changed `main` value in package.json to match `types` value style.
2019-01-17 09:46:57 +01:00
Jeroen Akkerman
88a1411462
Update types/easymde.d.ts
Co-Authored-By: FranklinWhale <FranklinWhale@users.noreply.github.com>
2019-01-16 23:04:19 +08:00
Franklin Tse
ce4171a3b7 Add license, use ReadonlyArray 2019-01-16 22:07:52 +08:00
Franklin Tse
4e6b0876e9 Initial commit 2019-01-16 21:32:41 +08:00
Jeroen Akkerman
b31c0a1a02 Added role="button" to toolbar buttons, closes #38 2018-12-20 01:57:12 +01:00
Jeroen Akkerman
75cfd34191 Fix eraser icon not working in FA5 2018-11-09 14:41:48 +01:00
Jeroen Akkerman
7c9186d223 Merge branch 'master' into development 2018-11-09 14:29:46 +01:00
Jeroen Akkerman
3551c6c003 Change badge styles to for-the-badge 2018-11-09 14:28:55 +01:00
Jeroen Akkerman
cd92cc441a Merge branch 'release/2.4.2' 2018-11-09 11:05:02 +01:00
Jeroen Akkerman
7ddb988e79 Merge branch 'release/2.4.2' into development 2018-11-09 11:05:01 +01:00
Jeroen Akkerman
226a1d22b5 Build dist files 2018-11-09 11:04:46 +01:00
Jeroen Akkerman
9fa18cee1e Bump version numbers 2018-11-09 11:04:39 +01:00
Jeroen Akkerman
09ba21374d Add Node 11 to Travis CI 2018-11-09 10:57:35 +01:00
Jeroen Akkerman
fbbc23df0e Update package-lock.json to resolve security issue. 2018-11-09 10:50:50 +01:00
Jeroen Akkerman
604f2c8ea9
Merge pull request #31 from adamb70/master
Fix autosave event handler
2018-11-09 10:40:50 +01:00
Jeroen Akkerman
e81e1f2c38 Fix sub-icons issue with FA5 2018-11-09 10:37:20 +01:00
Jeroen Akkerman
bc49e2589e Update codemirror 2018-11-09 10:25:42 +01:00
Jeroen Akkerman
d81b2326f6 Change deprecated "prepublish" to "prepare" in package.json. 2018-11-09 10:25:06 +01:00
adamb70
04777b49fb
Merge pull request #3 from adamb70/fix-autosave-submit-handler
Use user autosave delay
2018-11-08 18:37:04 +00:00
adamb70
7cbfacbbdd Use user autosave delay 2018-11-08 18:35:44 +00:00
adamb70
613fb0fcad
Merge pull request #2 from adamb70/fix-autosave-submit-handler
Update src/js/easymde.js
2018-11-08 18:10:02 +00:00
adamb70
265b2ed9d4 Update src/js/easymde.js 2018-11-08 18:08:27 +00:00
Jeroen Akkerman
d0e64127ac Merge branch 'release/2.4.1' 2018-10-15 13:45:59 +02:00
Jeroen Akkerman
098236a153 Merge branch 'release/2.4.1' into development 2018-10-15 13:45:59 +02:00
Jeroen Akkerman
5af2ac1b41 Update packages and bump version number. 2018-10-15 13:44:56 +02:00
Jeroen Akkerman
8d5dd2517d Merge branch 'master' into development 2018-10-15 13:38:28 +02:00
Jeroen Akkerman
886f465335
Merge pull request #27 from Summon528/master
Add fa-redo class for FA5
2018-10-15 11:04:08 +02:00
Summon528
3588edd929
Add fa-redo class for FA5 2018-10-06 12:09:16 +08:00
jeroen.akkerman
4c3ee66e35 Merge branch 'release/2.4.0' 2018-08-14 13:34:10 +02:00
jeroen.akkerman
43abcaf655 Bump version and build new files for distribution 2018-08-14 13:25:55 +02:00
jeroen.akkerman
34e1a02bbf Merge remote-tracking branch 'origin/master' into development 2018-08-14 13:24:14 +02:00
Jeroen Akkerman
900a0c4d7c
Merge pull request #19 from aphitiel/fullscreen-without-toolbar
Fullscreen without toolbar
2018-08-14 12:26:06 +02:00
Jeroen Akkerman
95abc3ef1b
Merge pull request #17 from LeviticusMB/themable
Made EasyMDE themable (again?).
2018-08-14 12:17:28 +02:00
Jeroen Akkerman
cbd638d93a
Super small edit to (hopefully) retrigger CI
CI feedback was broken in this pull request, this small irrelevant edit will hopefully fix that.
2018-08-14 10:01:55 +02:00
pk
b8e7293516 Fix fullscreen not working with toolbar: false 2018-08-13 21:23:32 +02:00
jeroen.akkerman
23327bf21d Badges badges badges badges badges badgers badges badges badges badges! 2018-07-31 17:58:52 +02:00
jeroen.akkerman
8b6c7de99f Update version for onToggleFullScreen option, lint fix & updates. 2018-07-31 17:27:06 +02:00
Jeroen Akkerman
9b735ce20f
Merge pull request #16 from n-3-0/development
Add optional onToggleFullScreen support from options
2018-07-31 17:01:36 +02:00
Jeroen Akkerman
21ef42937c
Merge pull request #13 from sne11ius/development
Add searchcursor plugin
2018-07-31 17:00:19 +02:00
Martin Blom
e6537588e8 Forgot to commit doc change. 2018-07-29 11:59:50 +02:00
Martin Blom
35b2176bac Made EasyMDE themable (again?).
* The default theme is 'easymde', but can be overridden by options.theme.
* Changed styles to use this theme as selector instead of .CodeMirror.
* Dropped unnecessary .cm-strikethrough styling.
* Added .cm-quote styling.
* Changed .CodeMirror-selected rule to match codemirror.css.
2018-07-29 10:08:54 +02:00
N-3-0
efda8d4a21 n-3-0 : Add optional onToggleFullScreen support from options 2018-07-15 03:04:10 -06:00
Unknown
7fb35ce968 Merge branch 'development' 2018-06-29 11:45:12 +02:00
jeroen.akkerman
382449c0bc Deploy does not work when combining both tags and branch filters. 2018-06-29 11:16:16 +02:00
Unknown
7fda2e09dd Merge branch 'development' 2018-06-29 10:54:10 +02:00
jeroen.akkerman
da4eba8d47 Update version in package-lock.json 2018-06-29 10:52:47 +02:00
jeroen.akkerman
18c03985ea Disabled text multi-select 2018-06-29 10:41:24 +02:00
Cornelius Wichering
b60b3cd184 Added searchcursor plugin 2018-05-28 22:08:02 +02:00
Jeroen Akkerman
f4905ea6b9 Increment version 2018-05-17 23:54:26 +02:00
Jeroen Akkerman
0bacebb176 NPM token was wrong according to Travis, created a new one 2018-05-17 23:47:14 +02:00
Jeroen Akkerman
3654672e8d api_key/secure was in the wrong place 2018-05-17 23:41:18 +02:00
Jeroen Akkerman
715d721aa8 Not sure what's wrong here 2018-05-17 23:39:45 +02:00
Jeroen Akkerman
e7b5611278 Indent might have been an issue 2018-05-17 23:34:54 +02:00
Jeroen Akkerman
fb5d8619bd Attempt at automatic publish on NPM
* Changed SimpleMDE to EasyMDE in contributing guidelines
* Added to the SimpleMDE / EasyMDE diff in the README
2018-05-17 23:24:53 +02:00
Jeroen Akkerman
23b96e5952
Merge pull request #11 from sne11ius/development
Fixed main: simplemde.js -> easymde.js
2018-05-17 23:05:01 +02:00
Cornelius Wichering
e0945b856a
Fixed main: simplemde.js -> easymde.js
Looks like the file itself was renamed but the package.json wasn't updated accordingly
2018-05-17 22:13:27 +02:00
Jeroen Akkerman
e50bffba36 Links in rendered preview will now open in a new tab by default. 2018-05-13 22:38:05 +02:00
Jeroen Akkerman
82d12b1830 Merge branch 'development' 2018-05-13 16:54:33 +02:00
Jeroen Akkerman
31310fc4dd Version 2.0.1 2018-05-13 16:49:19 +02:00
Jeroen Akkerman
c8614d9186 Fixed CSS that was broken after my FA5 changes, fixes #9 2018-05-13 16:47:49 +02:00
Jeroen Akkerman
e8e2a0cd2a * Update gulp to version 4
* Added Windows/Linux shortcuts to documentation
* Drop Node 4 testing
* Added Node 10 testing
* Updated packages
2018-05-13 01:00:38 +02:00
Jeroen Akkerman
fd1665d012
Fixed incorrect jQuery selector example, fixes #8 2018-05-09 10:28:22 +02:00
jeroen.akkerman
2adb4dcfa1 Updated documentation 2018-04-25 15:32:52 +02:00
Unknown
4bc5500d18 Merge branch 'master' into development 2018-04-23 15:58:56 +02:00
Unknown
d27e70d99c Merge branch 'development' 2018-04-23 15:54:26 +02:00
jeroen.akkerman
9a1752c9d5 Version 2.0.0 & added badges 2018-04-23 15:52:34 +02:00
jeroen.akkerman
27f859b714 Merge branch 'development' 2018-04-23 15:38:52 +02:00
jeroen.akkerman
0786961de3 Complete rename to EasyMDE 2018-04-23 15:18:49 +02:00
Jeroen Akkerman
c30569edb3 Updated CodeMirror and Marked. Fixes #5
Now using exact versions in package.json, because the dist files can not update without a commit.
2018-03-31 19:29:14 +02:00
Jeroen Akkerman
7e4c2aa019
Added section explaining the fork 2018-01-24 10:58:55 +01:00
Jeroen Akkerman
c34cebefd6 Made entire edit field have cursor: text. 2017-12-10 01:18:21 +01:00
Jeroen Akkerman
4f99b7de49 Remove bower install guide 2017-12-05 13:55:02 +01:00
Jeroen Akkerman
68601d9d38 Fix guide button not working 2017-12-05 13:51:32 +01:00
Jeroen Akkerman
acf45c8d58 Update issue template 2017-12-05 12:43:17 +01:00
Jeroen Akkerman
888ebbbd16 Simplify build steps for styles & delete debug folder 2017-12-05 12:26:23 +01:00
Jeroen Akkerman
d20fe36554 Simplify build steps for scripts 2017-12-05 12:15:24 +01:00
Jeroen Akkerman
70236ba68e Use single quotes 2017-12-05 11:56:56 +01:00
Jeroen Akkerman
de26368ad1 Set indent style to 4 spaces 2017-12-05 11:51:36 +01:00
Jeroen Akkerman
8a44ba70fb Edit header & build new dist files. Removed prettify tasks. 2017-12-05 11:41:40 +01:00
Jeroen Akkerman
519f51384b Continuing this project, edit relevant files, drop bower. 2017-12-05 11:22:35 +01:00
Jeroen Akkerman
b9b8c2267b Set version packages and add lock file, this is much safer. 2017-12-04 14:41:32 +01:00
Jeroen Akkerman
e5f39d6bfa Pls don't go away again... 2017-12-04 14:38:17 +01:00
Jeroen Akkerman
745f38ceda Guide button should not be disabled when preview is active. 2017-12-04 12:14:28 +01:00
Jeroen Akkerman
6c78e22af9 Dropped Node 5 support, added Node 8 and Node 9 support. 2017-12-04 12:13:10 +01:00
Jeroen Akkerman
24fae9d68f Changed link and image defaults to https:// 2017-12-04 12:10:07 +01:00
Jeroen Akkerman
89ed815735 Small CSS changes
* Removed opacity change on hover.
* Removed default opacity.
* Remove default button color.
* Added opacity change on button disable.
2017-12-04 12:06:59 +01:00
Jeroen Akkerman
e45dcec53f Added newline back to end of file (IDE mistake) 2017-12-04 11:43:05 +01:00
Jeroen Akkerman
7b147b3148 Added FontAwesome 5 compatibility without breaking FontAwesome 4 compatibility. 2017-12-04 11:29:21 +01:00
Jeroen Akkerman
60a4bb6392 Fix linting errors so project actually builds. 2017-12-04 11:16:25 +01:00
Wes Cossick
e32fe3f91c Update how to install 2017-05-17 13:02:19 -05:00
Wes Cossick
affcfd9ac1 Update company name 2017-05-16 14:09:14 -05:00
Wes Cossick
2623a5e689 Fix typo in README with missing colons 2017-04-25 15:40:05 -05:00
Wes Cossick
f9b7a984b2 Document new promptTexts option in README 2017-04-25 15:39:53 -05:00
Wes Cossick
93e876562f Merge pull request #520 from stadtgestalten/translatable-prompt-texts
allow promptTexts to be translated via options
2017-04-25 11:18:57 -05:00
Wes Cossick
ee11454138 Merge pull request #530 from awjecc/AllowToDisableSyncingScrollViaOptions
Allow to disable syncing scroll in side-by-side mode via options
2017-04-25 11:15:25 -05:00
Tsubasa
c6483297f7 Add the example non-default usage for syncSideBySidePreviewScroll
option.
2017-03-02 10:43:41 +09:00
Tsubasa
5d1648a510 Rename syncPreviewSideScroll to syncSideBySidePreviewScroll 2017-03-02 10:30:05 +09:00
Tsubasa
004cf8e731 Revert dist/simplemde.min.js 2017-03-02 10:26:16 +09:00
Wes Cossick
547ddfd9d5 Merge pull request #532 from stephenoakman/514-mobile-text-selection
Defaulting styleSelectedText to false if on a mobile device
2017-03-01 16:07:22 -06:00
Wes Cossick
0b4b70a4a2 Merge pull request #527 from luclu/fix-sideBySide-fullscreen-toggle
Fix toggleFullscreen() if icon is hidden
2017-03-01 15:58:02 -06:00
Stephen Oakman
c0dc7abb73 Defaulting styleSelectedText to false if on a mobile device 2017-02-27 12:11:08 +00:00
Wes Cossick
44b5b14e9b Merge pull request #523 from jrsinclair/development
Addressing accessibility issues with using links instead of buttons.
2017-02-27 01:03:56 -06:00
Wes Cossick
de7c68b9e5 Merge pull request #517 from boristhuy/boristhuy-css-modifications
[#493] Fix wrapping issues in live preview and Side By Side
2017-02-27 00:42:12 -06:00
Tsubasa
775e448518 Allow to disable syncing scroll in side-by-side mode via options 2017-02-25 12:44:45 +09:00
Luca Zeug
18f8256a4a Fix toggleFullscreen() if icon is hidden 2017-02-22 20:37:52 +01:00
James Sinclair
4bf96ffd32 Addressing accessibility issues with using links instead of buttons. 2017-02-18 07:38:19 +11:00
Konrad Mohrfeldt
125200fb35 allow promptTexts to be translated via options 2017-02-09 17:07:11 +01:00
Boris Thuy
7fa15473ad Added word-wrap property to CodeMirror class
(Absurdly) long words would cause the live preview to scroll indefinitely on the x-axis. Adding a word-wrap property to the CodeMirror class and setting its value to break-word seems to fix this issue.
2017-02-03 03:46:09 +01:00
Boris Thuy
20eb8d6da8 Added word-wrap to editor-preview-side class
The editor preview side currently scrolls indefinitely on the x-axis with (absurdedly) long words. Adding a word-wrap property and set it to break-word seems to fix the issue.
2017-02-03 03:29:16 +01:00
Boris Thuy
f5c62f70e8 Added box-sizing to the CodeMirror class
The editor view in Side By Side does not wrap lines properly (ie. they sometimes overflow beneath the live preview). Adding box-sizing property seems to fix this issue.
2017-02-03 03:19:22 +01:00
Wes Cossick
5b8611628b Merge pull request #472 from Mummakill/fix-multiline-list
Fix multiline numbered list function
2016-12-06 16:57:37 -06:00
Mummakill
b9071f0c91 Fix multiline numbered list function 2016-11-23 19:00:34 +02:00
Wes Cossick
6065d3e089 Update README.md 2016-10-25 14:29:31 -05:00
Wes Cossick
e747b053dc Update README.md 2016-10-25 14:29:10 -05:00
Wes Cossick
666e97e883 GitHub file changes 2016-08-11 11:36:51 -05:00
Wes Cossick
b5407e01e0 Fix typo in code 2016-08-04 10:06:19 -05:00
Wes Cossick
7e58a01a35 Merge pull request #404 from hansottowirtz/fix_399
Fix preview not rerendering when setting value
2016-07-30 17:39:17 -05:00
Hans Otto Wirtz
568da438c6 Fix preview not rerendering when setting value 2016-07-30 13:55:58 +02:00
Wes Cossick
c2ca78c46b Rebuild project 2016-07-29 09:18:30 -05:00
Wes Cossick
a1fd3255f9 Merge pull request #395 from lukasz89/togglelists
Fix lists exchanges
2016-07-27 10:21:04 -05:00
Lukasz Ostrowski
7770df785c revert dist files 2016-07-27 09:38:18 +02:00
Lukasz Ostrowski
d44eea64e3 commit dist files 2016-07-26 10:34:09 +02:00
Lukasz Ostrowski
2d7e776ba0 commit dist files 2016-07-26 09:56:19 +02:00
Wes Cossick
63d1621a20 Tweak wording of hljs option 2016-07-25 18:22:35 -05:00
Wes Cossick
d953e0b871 Merge pull request #397 from riggerthegeek/development
Added a parameter to pass in highlight.js in from the renderConfig
2016-07-25 18:20:18 -05:00
Simon
a987a8bb64 Added a parameter to pass in highlight.js in from the renderConfig
Previously, if you wanted to use highlight.js to render the preview, you had to have hljs on the window object. In practice, this is poor and negates many of the
principles behind using Browserify. By injecting it in as a parameter, this means the client can avoid adding things to their global scope if they don't/can't
avoid that.

This is a non-breaking change, only adding a new option to an existing API. The default behaviour is unchanged
2016-07-25 12:24:03 +01:00
Lukasz Ostrowski
6787ae706e list toggle fix 2016-07-25 10:40:54 +02:00
Lukasz Ostrowski
61991d1e7d list toggle fix 2016-07-25 10:16:14 +02:00
Lukasz Ostrowski
c849cc95b2 list toggle 2016-07-22 17:04:36 +02:00
Wes Cossick
580a4b0286 Merge pull request #382 from jonatanklosko/issue-98
Fix bug with inserting links and undoing things.
2016-07-12 11:43:24 -05:00
Jonatan Kłosko
6250a7d7e7 Fix bug with inserting links and undoing things. 2016-07-12 00:53:45 +02:00
Wes Cossick
7ae3e6517b Merge pull request #378 from gaetanm/master
Delete editor right border + its radius in full screen mode
2016-07-11 16:26:56 -05:00
Gaëtan Masson
8c9667980c Delete editor right border + its radius in full screen mode 2016-07-10 21:58:46 +02:00
Wes Cossick
1872a278c6 Tweak wording for minHeight setting 2016-07-10 13:07:00 -05:00
Wes Cossick
c76d4d4641 Merge pull request #373 from jonatanklosko/min-height-option
Add an option indicating a minimal height of the editable area.
2016-07-10 13:03:31 -05:00
Wes Cossick
69a63791f0 Remove support for Node.js version 0.12.x. 2016-07-10 13:02:32 -05:00
Jonatan Kłosko
517d5ee249 Add an option indicating a minimal height of the editable area. 2016-07-08 15:31:30 +02:00
Wes Cossick
5081e100a6 Tweak README wording 2016-06-22 13:00:10 -05:00
Wes Cossick
f2d1af5dee Merge pull request #366 from kongregate/configure-marked
Allow user to configure marked options
2016-06-22 12:57:54 -05:00
Josh Schonstal
b0b2f1d4a3
Allow user to configure marked options 2016-06-22 09:36:09 -07:00
Wes Cossick
6abda7ab68 Merge pull request #361 from NextStepWebs/development
Fix broken dependency
2016-06-14 12:57:04 -05:00
Wes Cossick
1471a4e662 Merge branch 'master' into development 2016-06-14 12:50:07 -05:00
Wes Cossick
0d9f7d9012 Update code and version 2016-06-14 12:48:07 -05:00
Wes Cossick
2c35e6782f 1.11.2 2016-06-14 12:46:09 -05:00
Wes Cossick
cb10536dd4 Update bower version 2016-06-14 12:46:03 -05:00
Wes Cossick
00e0f69d93 Merge pull request #356 from NextStepWebs/development
Republishing to NPM
2016-06-09 15:42:10 -05:00
Wes Cossick
98bc1e52a1 Update version 2016-06-09 15:26:41 -05:00
Wes Cossick
47b2667e86 1.11.1 2016-06-09 15:22:15 -05:00
Wes Cossick
316b8a58f8 Merge pull request #353 from NextStepWebs/development
Development
2016-06-07 22:54:06 -05:00
Wes Cossick
6676411766 Update version in comments 2016-06-07 22:46:55 -05:00
Wes Cossick
3653d4f81d 1.11.0 2016-06-07 22:46:32 -05:00
Wes Cossick
7dc2a8f7fe Revert "Revert this"
This reverts commit 021e70524275ad40459b6e13cbc82bb3fabfd990.
2016-06-07 22:46:19 -05:00
Wes Cossick
021e705242 Revert this 2016-06-07 22:46:15 -05:00
Wes Cossick
e74572ac4a Update version in bower 2016-06-07 22:46:11 -05:00
Wes Cossick
487ff36385 Rebuild project 2016-06-07 22:36:54 -05:00
Wes Cossick
d963582f16 Fix line and word count on init (#299) 2016-06-07 21:53:23 -05:00
Wes Cossick
69bff3ed78 Fix CodeMirror bug with init text (#344) 2016-06-07 21:43:25 -05:00
Wes Cossick
b4d4e89129 Fix selection bug when toggling between side-by-side (#309) 2016-06-07 21:40:40 -05:00
Wes Cossick
c949cad2d8 Update URLs; prefer SSL 2016-06-07 21:33:34 -05:00
Wes Cossick
c8f23a3aa9 Clean up build process, Use new CodeMirror Spell Checker 2016-06-07 21:28:01 -05:00
Wes Cossick
dbb1c25843 Travis CI now tests against Node.js 6 2016-06-07 21:28:01 -05:00
Wes Cossick
a30d8f6183 Fix #326 2016-06-07 21:28:01 -05:00
Wes Cossick
51ef0cd81d Merge pull request #351 from amka/patch-2
Add support for count Cyrillic words
2016-06-07 21:18:55 -05:00
Wes Cossick
97154e2bfc Merge pull request #345 from jbutz/development
Prevent onclick event from bubbling
2016-06-07 21:07:01 -05:00
Andrey M
bd33cd3c2b Add support for count Cyrillic words
Add unicode range for Cyrillic characters
2016-06-07 03:39:01 +04:00
Jason Butz
7187fb26fb Adjust whitespace characters 2016-06-03 09:09:33 -04:00
Jason Butz
f21cca3068 Prevent onclick event from bubbling 2016-06-03 09:07:15 -04:00
Wes Cossick
b6b1f7c1ef Merge pull request #304 from bbemis017/readmeError
Readme error
2016-04-22 18:56:43 -05:00
Wes Cossick
0ce450a7a7 Merge pull request #301 from JHeiner/issue150
Fix issue #150: use correct paths for dependencies.
2016-04-22 18:52:01 -05:00
Benjamin Bemis
d9d0cd50d5 Fixed Syntax Error in readme file 2016-04-22 19:38:20 -04:00
Jeremy Heiner
7b1e8deeaa Fix issue #150: use correct paths for dependencies.
https://nodejs.org/api/modules.html specifies what paths are
correct. One should never explicitly put "node_modules" in
dependency paths because npm is under no obligation to put things
where you told it to look for them. Issue #150 arises when
SimpleMDE is a dependency in some other project, so it and its
dependencies are peers under that project's "node_modules", and
there is no "./node_modules" within the SimpleMDE folder.

TL/DR: npm tells you where it puts dependencies, not vice versa.
2016-04-19 20:02:53 -04:00
Wes Cossick
e72e51c94f Merge pull request #297 from prostoandrei/development
Fix #286
2016-04-09 21:19:59 -05:00
Wes Cossick
4ec9ab8be0 Tweak documentation for styleSelectedText 2016-04-09 21:18:03 -05:00
Wes Cossick
6ed8344248 Fix documentation for styleSelectedText 2016-04-09 21:17:07 -05:00
Wes Cossick
2f4e7e4d9b Merge pull request #289 from foreachlt/style-selected-text
Added mark-selection plugin
2016-04-09 21:16:09 -05:00
andrey.vaganov
318b4c175f Merge branch 'development' of https://github.com/prostoandrei/simplemde-markdown-editor into development
Conflicts:
	debug/simplemde.debug.js
	debug/simplemde.js
	dist/simplemde.min.js
	src/js/simplemde.js
2016-03-31 13:36:05 +03:00
andrey.vaganov
fe1318dd39 fix issue #286 2016-03-31 13:34:12 +03:00
andrey.vaganov
4a8ce0bd12 fix issue #286 2016-03-31 12:14:39 +03:00
Kasparas Galdikas
490e57ded1 Added mark-selection plugin from CodeMirror with config option on simplemde 2016-03-25 15:56:44 +00:00
Wes Cossick
9eb0411d82 Merge pull request #284 from foreachlt/console
Removed console.log left overs
2016-03-25 09:58:32 -05:00
Kasparas Galdikas
be3fbf15b5 Removed console.log left overs 2016-03-20 14:55:19 +00:00
Wes Cossick
6eae597a69 Merge pull request #277 from NextStepWebs/development
Allow destroying instance, Prompts, README changes, Fix bugs, More
2016-03-14 21:39:46 -05:00
Wes Cossick
507e8ce67d Merge branch 'master' into development 2016-03-14 21:34:58 -05:00
Wes Cossick
24ec612c44 Fix linting and update dependencies 2016-03-14 21:28:56 -05:00
Wes Cossick
747b3ef065 Rebuild project 2016-03-14 20:59:59 -05:00
Wes Cossick
26391efa26 Better localStorage detection 2016-03-14 20:59:16 -05:00
Wes Cossick
d77d4b318b Update version 2016-02-25 15:08:38 -06:00
Wes Cossick
1def5aabc2 1.10.1 2016-02-25 15:08:38 -06:00
Wes Cossick
711af1b472 Merge pull request #264 from NextStepWebs/pr/256
Pull request #256 remove conflicts
2016-02-25 15:07:33 -06:00
Wes Cossick
75b6c82940 Make compatible and able to be merged 2016-02-25 15:00:52 -06:00
Wes Cossick
1a79eefadb Hide trailing separators respects hidden icons 2016-02-25 14:53:08 -06:00
Wes Cossick
6bda28300d Fix single line breaks bug 2016-02-25 14:48:05 -06:00
Wes Cossick
435b39f96d Update dependencies 2016-02-25 14:47:56 -06:00
Wes Cossick
787ed40fe6 Update URLs to use SimpleMDE.com 2016-02-25 14:17:41 -06:00
Curtis Badke
ecff05833b Add forceSync to non-default options listing. 2016-02-12 11:17:43 -07:00
Curtis Badke
20f5b54a46 Fix naming and style based on feedback
* forceSynch -> forceSync
* change documentation description
2016-02-10 13:01:22 -07:00
Curtis Badke
0fb087ca38 Add forceSynch option which will autosave to textarea.
Since this is built on CodeMirror I opted to use CodeMirror's save
behaviour rather than pulling the value and stomping on the textarea's
innerHtml.

Fixes #193
2016-02-10 03:56:39 -07:00
Wes Cossick
71d979ad61 Use SSL URLs 2016-01-27 11:26:19 -06:00
Wes Cossick
56705bfd20 Tweak wording in README 2016-01-26 10:43:25 -06:00
Wes Cossick
8618543fab Merge pull request #242 from moczolaszlo/development
Optional prompt windows to Link and Image
2016-01-26 10:41:29 -06:00
Laszlo Moczo
5a53199586 Optional prompt windows to Link and Image 2016-01-26 10:39:27 +01:00
Laszlo Moczo
eb568ddbde Merge remote-tracking branch 'NextStepWebs/development' into development 2016-01-26 10:22:09 +01:00
Wes Cossick
047c0ef2c7 Merge pull request #228 from brondsem/context_aware_code_block_button
Context aware code button
2016-01-25 20:31:09 -06:00
Dave Brondsema
0166b2b367 Update dist/simplemde.min.js 2016-01-25 17:48:22 -05:00
Dave Brondsema
2c09c829ee When selecting lines within a fenced block, check if selection reaches a fenced line 2016-01-25 17:47:58 -05:00
Dave Brondsema
5e204ae66e Update token state checking to work when spellcheck is on 2016-01-25 15:09:30 -05:00
Dave Brondsema
bce5372947 Context aware code button to handle toggling on and off code blocks and inline code markup 2016-01-25 15:09:30 -05:00
Laszlo Moczo
26519235c6 Optional prompt windows to Link and Image
Optional prompt windows to Link and Image
2016-01-25 14:14:46 +01:00
Wes Cossick
99e4cba72e Merge pull request #239 from trwired/destroy-instance
Allow reverting back to the initial textarea (fixes #142)
2016-01-24 21:33:13 -06:00
trwired
fd8e6a7825 Allow reverting back to the initial textarea (fixes #142) 2016-01-24 07:29:18 +01:00
Wes Cossick
b6bee016c2 Merge pull request #238 from trwired/fix-196
Fix #196
2016-01-23 18:58:57 -06:00
trwired
da5e309ffe fixes #196 2016-01-23 23:40:31 +01:00
Wes Cossick
d1445222aa Remove "What's Changed" secion, Reword "How it works" 2016-01-22 23:39:45 -06:00
Wes Cossick
6318fc1b19 Merge pull request #237 from NextStepWebs/development
Placeholder, Character counter, New icons, Customizable keyboard shortcuts, Custom status items, Bug fixes
2016-01-22 14:43:19 -06:00
Wes Cossick
4b75a4e38e Tweak README for the last time 2016-01-22 14:05:05 -06:00
Wes Cossick
cc4cd7acdd Tweak wording some more 2016-01-22 13:59:40 -06:00
Wes Cossick
1e51e98649 Tweak status bar wording 2016-01-22 13:59:00 -06:00
Wes Cossick
3da94ef677 Better separator display/hide logic 2016-01-22 13:16:54 -06:00
Wes Cossick
6b6bb408cf Refactor custom status bar items 2016-01-22 13:02:39 -06:00
Wes Cossick
a318e44ffe Rebuild project again 2016-01-22 12:28:49 -06:00
Wes Cossick
dba58abd59 1.10.0 2016-01-22 12:27:37 -06:00
Wes Cossick
f1865e5536 Update version and rebuild project 2016-01-22 12:26:50 -06:00
Wes Cossick
120d7e5c85 Merge pull request #233 from ryan-codingintrigue/development
Add support for custom counts in statusbar
2016-01-22 12:10:56 -06:00
Ryan Graham
7904c44036 Updated README to explain statusCustom support 2016-01-21 12:13:35 +00:00
Ryan Graham
7bc2cb3c41 Add support for custom options in status bar 2016-01-21 12:12:30 +00:00
Wes Cossick
91a27e314a Merge pull request #229 from adam187/feature/get-state
Improve get state
2016-01-20 16:54:12 -06:00
Adam Misiorny
62caea601e improve get state, add public getter 2016-01-20 21:50:59 +01:00
Wes Cossick
7aedb8623a Fix options undefined bug when clearing autosave value
Occurred when the autosave option was not present and a user tried to clear the autosaved value.
2016-01-13 00:46:35 -06:00
Wes Cossick
0d9078c98d Merge pull request #223 from trwired/user-configurable-shortcuts
Gives users the ability to change editor's keyboard shortcuts
2016-01-11 22:52:01 -06:00
trwired
131e5d8beb Included info on configuring and using custom keyboard shortcuts 2016-01-09 10:13:16 +01:00
trwired
b61c64d63c Resolved merge conflict with upstream 2016-01-09 08:40:24 +01:00
Wes Cossick
eccfbe5f20 Merge pull request #224 from adam187/feature/clean-block
Clean block feature
2016-01-08 16:46:31 -06:00
Adam Misiorny
664c081876 cs fixes 2016-01-08 17:42:40 +01:00
Adam Misiorny
144d724a41 update clean block pattern 2016-01-08 17:28:45 +01:00
Adam Misiorny
8469cbc839 add clean block feature 2016-01-08 15:06:41 +01:00
Igor Kalat
16042564a1 Gives users the ability to change editor's keyboard shortcuts 2016-01-07 10:38:19 +01:00
Wes Cossick
2bac0bbcec Merge pull request #220 from adriaanzon/development
Fix table spacing
2016-01-06 10:32:46 -06:00
Wes Cossick
b092fe5ee0 Merge pull request #218 from JamieWohletz/development
Added undo and redo buttons to toolbar
2016-01-06 10:30:22 -06:00
adriaanzon
aa2ebfe983 Fix table spacing
Removed an extra space that caused the tables to be wrongly aligned, when the table button was pressed.
2016-01-06 15:46:26 +01:00
Jamie Wohletz
2f24d571b0 Undo + Redo buttons are no longer added by default 2016-01-03 12:55:57 -07:00
Jamie Wohletz
68be24121f Added undo and redo buttons to toolbar 2016-01-03 01:14:18 -07:00
Wes Cossick
0ce602f68d Merge pull request #211 from 7upcat/master
Fix #206 added useSideBySideListener
2015-12-18 19:00:12 -06:00
7cat
9fb97e0d5e Fix #206 added useSideBySideListener 2015-12-19 06:33:04 +08:00
7cat
e27a0933a3 Added useSideBySideListener avoid duplicate cm update 2015-12-19 06:25:47 +08:00
7cat
e96fddffcb Update simplemde.js 2015-12-18 16:38:40 +08:00
郑哲明
4fe8ad6cdf Fix bug related with issue #206
When user click 'toggleSideBySide'  button will always register a new
'update' listener .Modify the logic if toggle on register a listener  if
toggle off  remove the listener.
2015-12-18 16:32:50 +08:00
Wes Cossick
e89b0e4049 Merge pull request #207 from vladson/master
Add characters count to status bar.
2015-12-17 22:14:24 -06:00
Vladislav Bogomolov
6c61b1a4aa Add characters count to status bar. 2015-12-18 01:35:29 +03:00
郑明明
b9f77e0bea Adding support for asciidoctor
A editor that can edit asciidoctor online .....
It seems the performance of the editor is not good.
2015-12-18 00:07:19 +08:00
Wes Cossick
6e659cf0ab Merge pull request #199 from adam187/feature/placeholder
add placeholder option
2015-12-10 16:01:59 -06:00
Adam Misiorny
3178aab2cb add styling for placeholder element 2015-12-10 22:55:54 +01:00
Adam Misiorny
95cfe5a353 change spaces to tab 2015-12-10 22:46:31 +01:00
Adam Misiorny
c92f4e3bd3 change single quotes to double quotes 2015-12-10 07:58:19 +01:00
Adam Misiorny
f891cfb787 add placeholder option 2015-12-09 00:20:42 +01:00
Wes Cossick
5f3a67dae2 Merge pull request #189 from NextStepWebs/development
Autosave improvements, Build improvements, New icons, New options, Clearer README
2015-12-05 00:55:28 -06:00
Wes Cossick
7a2e75eb48 Merge branch 'master' into development 2015-12-05 00:50:55 -06:00
Wes Cossick
3f54710784 Bump to version 1.9.0 2015-12-05 00:48:59 -06:00
Wes Cossick
5706319644 Full build 2015-12-05 00:37:20 -06:00
Wes Cossick
4eec6e6e3a Document showIcons; Tweak other wording 2015-12-05 00:37:12 -06:00
Wes Cossick
d30d9b7d00 Fix initial value overwriting autosaved value 2015-12-05 00:31:27 -06:00
Wes Cossick
36f97604f4 Refactor default toolbar organization; Allow showIcons setting (#170) 2015-12-05 00:18:40 -06:00
Wes Cossick
4dbe95fe80 Fixes #163 where tabbing through form would land on icons 2015-12-04 23:41:24 -06:00
Wes Cossick
17dad384bc Fix #166, z-index inconsistencies causing scroll issues 2015-12-04 19:52:34 -06:00
Wes Cossick
396de5f46c Fix #167 where escape key wouldn't always work 2015-12-04 19:48:26 -06:00
Wes Cossick
4b308e0c89 Travis.yml: Broader Node version testing 2015-12-04 19:23:41 -06:00
Wes Cossick
b21808ed12 Fix trailing space after vinyl-buffer 2015-12-04 19:19:22 -06:00
Wes Cossick
cac5699594 Fix travis config 2015-12-04 17:55:49 -06:00
Wes Cossick
c2cf41fc16 Update dependencies; Travis build in more node versions 2015-12-04 17:34:31 -06:00
Wes Cossick
169752eb9d More clearly document custom button code 2015-12-04 14:31:33 -06:00
Wes Cossick
170cbd0b2f Merge pull request #185 from adam187/feature/block-styles
add ability to set up markup for bold and italic
2015-11-30 11:09:41 -06:00
Wes Cossick
b4ee8a06e4 Fix small typo 2015-11-30 11:07:12 -06:00
Adam Misiorny
e7c45cfeec Update README.md 2015-11-30 17:53:41 +01:00
Wes Cossick
8a1d8fd285 Merge pull request #186 from adam187/fix/autosave-condition
fix condition for checking unique_id in autosave option
2015-11-30 10:06:26 -06:00
Adam Misiorny
19463486ef improve readme 2015-11-30 10:24:32 +01:00
Adam Misiorny
54fa76d798 update condition 2015-11-30 10:18:26 +01:00
Adam Misiorny
abedc7371d add ability to set up markup for bold and italic 2015-11-29 21:31:17 +01:00
Adam Misiorny
c7c940c614 fix condition for checking unique_id in autosave option when autosave is not defined 2015-11-29 21:13:40 +01:00
Wes Cossick
42c4a0bbef Merge pull request #184 from qumberhussain/development
Updated documentation for adding table
2015-11-25 13:56:20 -06:00
Qumber
d850ff7f0c Updated documentation for adding table 2015-11-25 10:07:51 +00:00
Wes Cossick
a31e978659 Merge pull request #182 from qumberhussain/development
Added support for tables
2015-11-24 12:14:33 -06:00
Qumber
342e853c19 Added support for tables 2015-11-24 17:54:41 +00:00
Wes Cossick
e8bdc03120 Update package.json to 1.8.2 2015-11-19 17:25:47 -06:00
Wes Cossick
dac02f2698 Update bower version 2015-11-19 17:25:03 -06:00
Wes Cossick
9d0b313320 Rebuild 2015-11-19 17:23:32 -06:00
Wes Cossick
a64f07e1c3 Autosave improvements (see description)
Checks that localStorage is available for all features, logs error if
not
Added function to clear the autosaved value
Prefixed the autosave localStorage key with “smde_”
2015-11-19 17:22:03 -06:00
Wes Cossick
a70b4978cb Rebuild project 2015-11-19 14:47:24 -06:00
Wes Cossick
52ed959be9 Change unique_id to uniqueId 2015-11-19 14:47:15 -06:00
Wes Cossick
7d5bd5f27e Depend on specific marked version 2015-11-19 14:39:00 -06:00
Wes Cossick
eb7f5cac53 Rebuild 2015-11-16 00:01:48 -06:00
Wes Cossick
90733ec404 Fix autosave briefly losing saved value 2015-11-16 00:01:44 -06:00
Wes Cossick
e05962d91c Merge pull request #156 from NextStepWebs/development
Introduce Travis CI builds
2015-11-03 22:30:54 -06:00
Wes Cossick
69e65ac0d1 Make autosave option more clear 2015-11-03 22:24:28 -06:00
Wes Cossick
06454332ba Format Travis file properly 2015-11-03 22:07:45 -06:00
Wes Cossick
becd1317ff Trigger Travis CI build with small change 2015-11-03 22:01:40 -06:00
Wes Cossick
6d44a0aa14 Merge branch 'master' into development 2015-11-03 15:50:06 -06:00
Wes Cossick
e295645d93 Document Travis CI requirement 2015-11-03 15:48:54 -06:00
Wes Cossick
9aa32df7e1 Revert "Note Travis CI requirement"
This reverts commit 0cd00edb937cff9906dbe592c8773d0f1fe2ea36.
2015-11-03 15:48:07 -06:00
Wes Cossick
0cd00edb93 Note Travis CI requirement 2015-11-03 15:46:22 -06:00
Wes Cossick
e42b85304d Auto deploy to npm 2015-11-03 15:28:30 -06:00
Wes Cossick
adda6665c1 Update simplemde.js 2015-11-03 15:07:39 -06:00
Wes Cossick
a98665a0a7 Merge branch 'master' into development 2015-11-03 14:58:30 -06:00
Wes Cossick
08fc75b909 Gulp should fail after lint error 2015-11-03 14:54:29 -06:00
Wes Cossick
2c77d032e6 Force lint error to test Travis CI 2015-11-03 14:46:23 -06:00
Wes Cossick
804427835b Update .travis.yml 2015-11-03 14:45:51 -06:00
Wes Cossick
a9c100fe6c Update .travis.yml 2015-11-03 14:41:17 -06:00
Wes Cossick
4e1d01bcb7 Update .travis.yml 2015-11-03 14:31:30 -06:00
Wes Cossick
dbf8f15e34 Create .travis.yml 2015-11-03 14:26:28 -06:00
Wes Cossick
2d9e8956a1 REAMDE use double quotes 2015-11-03 11:37:00 -06:00
Wes Cossick
dab0b6be7b Merge pull request #155 from NextStepWebs/development
New option, HTML highlighting, Gulp build tweaks, Fix bugs
2015-11-03 11:33:50 -06:00
Wes Cossick
b98ad3fbf6 Commit latest build 2015-11-03 11:33:07 -06:00
Wes Cossick
73e5e5fb4e Change replaceTexts to insertTexts 2015-11-03 11:31:22 -06:00
Wes Cossick
c1c8de5115 Add comment to option demo code 2015-11-03 11:30:09 -06:00
Wes Cossick
fdcd613199 Document new option 2015-11-03 11:28:06 -06:00
Wes Cossick
b1505af98a Update dependencies 2015-11-03 11:19:55 -06:00
Wes Cossick
7c908ca39c Recompile with 1.8.1 comment 2015-11-03 11:03:58 -06:00
Wes Cossick
16434578f0 Change to 1.8.1 2015-11-03 11:01:35 -06:00
Wes Cossick
cc7f1b456a 1.8.1 2015-11-03 11:01:11 -06:00
Wes Cossick
788f371253 Tweak README wording 2015-11-03 10:51:38 -06:00
Wes Cossick
118a61b0d7 Update README to fix bug 2015-11-03 10:49:15 -06:00
Wes Cossick
361c097643 Fix gradient CSS 2015-11-03 10:29:46 -06:00
Wes Cossick
5e0aeee60d Gulp file prettifies src files 2015-11-03 10:16:20 -06:00
Wes Cossick
cef2623e2a Recompile files with latest commits 2015-11-03 10:16:08 -06:00
Wes Cossick
9157e862f9 Merge pull request #152 from alexcanessa/development
Add the replace selection text to the options.
2015-11-03 09:45:43 -06:00
Alex Canessa
8bf55b1b34 Add the replace selection text to the options. 2015-11-03 10:36:24 +00:00
Wes Cossick
e20b64c97a Fix bug with sprockets compilation 2015-10-26 10:37:00 -05:00
Wes Cossick
0e6e466346 Merge pull request #146 from NextStepWebs/revert-145-kleroy_fix-sprockets-compilation-error
Revert "Fix sprockets compilation error related to `filter: progid:`"
2015-10-26 10:36:29 -05:00
Wes Cossick
3baa1d1ac8 Revert "Fix sprockets compilation error related to filter: progid:" 2015-10-26 10:36:14 -05:00
Wes Cossick
16d5a4d894 Merge pull request #145 from kle-roy/kleroy_fix-sprockets-compilation-error
Fix sprockets compilation error related to `filter: progid:`
2015-10-26 10:36:01 -05:00
kleroy
e1b70d737e Fix sprockets compilation error related to filter: progid:
```
Invalid CSS after "...);filter:progid": expected ";", was ": DXImageTransf..."
```
2015-10-24 12:35:56 +02:00
Wes Cossick
cfb2f6c046 Gulp.js: Add header comment to all built files 2015-10-22 12:04:27 -05:00
Wes Cossick
063e6f99b1 Rebuild project with latest commits 2015-10-22 12:02:23 -05:00
Wes Cossick
de87b0ccd3 Added basic HTML tag syntax highlight styling 2015-10-21 10:04:21 -05:00
Wes Cossick
d3a2625bb2 Merge pull request #143 from NextStepWebs/revert-141-master
Revert "Added basic HTML tag syntax highlight styling"
2015-10-21 10:01:22 -05:00
Wes Cossick
b59279a3d8 Revert "Added basic HTML tag syntax highlight styling" 2015-10-21 10:01:11 -05:00
Wes Cossick
05f1d47210 Merge pull request #141 from danabrey/master
Added basic HTML tag syntax highlight styling
2015-10-21 10:00:59 -05:00
danabrey
e79b5f14ed Added basic HTML tag syntax highlight styling 2015-10-21 11:09:44 +01:00
Wes Cossick
1e3ddd01af Merge pull request #140 from NextStepWebs/development
Fix bower package name
2015-10-20 15:42:32 -05:00
Wes Cossick
0ec4eafeff Fix bower package name 2015-10-20 15:42:12 -05:00
Wes Cossick
653dde0d5d Merge pull request #139 from NextStepWebs/development
UMD design, Bower support, Linting, Bug fixes
2015-10-20 15:41:09 -05:00
Wes Cossick
0554746fd2 Update version to 1.8.0 and recompile 2015-10-20 15:26:48 -05:00
Wes Cossick
03b5ed2551 Fix preview overlap issue 2015-10-20 15:13:28 -05:00
Wes Cossick
55f3c243c8 Syntax highlight code in README 2015-10-20 15:03:43 -05:00
Wes Cossick
efc38f43da Update CodeMirror; Add three state methods 2015-10-20 15:01:14 -05:00
Wes Cossick
6215739a60 Add missing comma to README example code 2015-10-20 11:15:54 -05:00
Wes Cossick
b677adaeb9 Don't ignore hidden files for bower 2015-10-20 11:04:48 -05:00
Wes Cossick
773edca5fa Tweak wording of README 2015-10-20 11:04:24 -05:00
Wes Cossick
5662766c1f Note new ways to install, tweak format and wording 2015-10-20 10:59:35 -05:00
Wes Cossick
4333d2e5eb Update .gitignore 2015-10-20 09:46:56 -05:00
Wes Cossick
7e2508269c Create bower.json 2015-10-20 09:46:43 -05:00
Wes Cossick
111c5f7858 Fix typo 2015-10-20 09:43:09 -05:00
Wes Cossick
7bc9d9b0ff Merge pull request #137 from NextStepWebs/revert-134-master
Revert "Added bower support"
2015-10-20 09:36:27 -05:00
Wes Cossick
5b0dd8e50b Revert "Added bower support" 2015-10-20 09:36:15 -05:00
Wes Cossick
dc78ab2c6a Merge pull request #134 from FabianKoestring/master
Added bower support
2015-10-20 09:36:08 -05:00
Wes Cossick
dc5126b4fe Make linter happy 2015-10-19 12:53:40 -05:00
Wes Cossick
8e53037df9 Merge pull request #127 from PhantomXCool/development
Add Support UMD
2015-10-19 12:42:16 -05:00
Fabian Köstring
6fcc1e6406 Update bower.json 2015-10-16 10:42:17 +02:00
Fabian Köstring
b9e66d326c Update README.md 2015-10-16 10:41:01 +02:00
Fabian Köstring
bad108966d added bower support 2015-10-16 10:39:07 +02:00
PhantomX
cd60814099 1. move the non-minified compiled JS file to the /debug/ directory
2. Corrected dependency for "marked"
2015-10-15 13:01:16 +03:00
PhantomX
09c9126741 add browserify-shim for spell-checker
revert tablist.js
2015-10-14 12:04:22 +03:00
PhantomX
01306ad105 Remove spell-checker. Module 'spell-checker' must support CommonJS 2015-10-08 11:31:05 +03:00
Wes Cossick
effd98d463 Detect mobile and prevent fullscreen dependent features 2015-10-07 21:13:38 -05:00
PhantomX
df1e551c0f add UMD support and add linting utility for JavaScript ESLint 2015-10-07 23:52:14 +03:00
Wes Cossick
d9e66391d0 Update dist files 2015-10-05 10:47:54 -05:00
Wes Cossick
30c2844f37 1.7.5 2015-10-05 10:32:59 -05:00
Wes Cossick
416d807a92 Update to support allowDropFileTypes 2015-10-05 10:32:41 -05:00
Wes Cossick
be1697e170 Merge pull request #117 from NextStepWebs/development
Get the version numbers right
2015-09-25 22:15:09 -05:00
Wes Cossick
cee66d4873 Update version number 2015-09-25 22:14:01 -05:00
Wes Cossick
1560d4b7d7 1.7.4 2015-09-25 22:12:36 -05:00
Wes Cossick
c5e3905ae9 Update version number 2015-09-25 22:12:26 -05:00
Wes Cossick
b5eb5ee318 1.7.3 2015-09-25 22:09:34 -05:00
Wes Cossick
ec8bba319d Merge pull request #115 from NextStepWebs/development
Add dist files
2015-09-25 17:11:16 -05:00
Wes Cossick
c55b5c6ecb Commit distribution files 2015-09-25 17:10:10 -05:00
Wes Cossick
f32e103944 Merge pull request #114 from NextStepWebs/development
Intelligently download Font Awesome, New options, Bug fixes
2015-09-25 16:57:12 -05:00
Wes Cossick
8d07c5e7f4 Tweak formatting 2015-09-25 16:48:43 -05:00
Wes Cossick
443a58cc28 New option: renderingConfig which includes syntax highlighting 2015-09-25 16:47:24 -05:00
Wes Cossick
a52a9a0098 Use .no-disable and .no-mobile classes instead of .fa-X classes 2015-09-25 15:56:49 -05:00
Wes Cossick
5466648503 Rebuild project 2015-09-25 15:49:54 -05:00
Wes Cossick
42068c97f9 Fix bug with hideIcons 2015-09-25 15:33:35 -05:00
Wes Cossick
b0193b4110 Hide fullscreen button on mobile due to issues 2015-09-25 15:32:24 -05:00
Wes Cossick
d13b3d51cd Rebuild project 2015-09-25 15:21:39 -05:00
Wes Cossick
a93f7a2570 New hide icons option 2015-09-24 15:03:20 -05:00
Wes Cossick
0b48f1dc01 Remove tab list addon from gulp file 2015-09-21 11:48:37 -05:00
Wes Cossick
e18beb56f7 Remove debug output 2015-09-19 20:43:20 -05:00
Wes Cossick
bfda8350ae Auto download Font Awesome 2015-09-19 20:42:20 -05:00
Wes Cossick
c6e3a4bf55 Update to 1.7.2 and rebuild 2015-09-18 10:57:29 -05:00
Wes Cossick
54f80c1f0f Remove mention of fencedCodeBlocks option (will not work) 2015-09-18 10:57:15 -05:00
Wes Cossick
589386dc8a Fix URL matching RegEx 2015-09-18 10:57:02 -05:00
Wes Cossick
57fcf521a0 Merge pull request #107 from NextStepWebs/development
Custom preview rendering, Loads of bug fixes
2015-09-17 01:21:32 -05:00
Wes Cossick
cd17552bf6 Merge pull request #102 from arduanov/patch-2
Fix autosave
2015-09-17 01:06:10 -05:00
Wes Cossick
263827a690 Combine columns to prevent wrapping 2015-09-17 01:01:28 -05:00
Wes Cossick
f96ca0ecfa Rearrange options alphabetically 2015-09-17 00:57:03 -05:00
Wes Cossick
90d7bcce7e Compile distribution file 2015-09-17 00:53:13 -05:00
Wes Cossick
3dcb71e880 Update gulpfile.js to wait for downloads 2015-09-17 00:53:05 -05:00
Wes Cossick
1762dea647 More defensive coding for #91 2015-09-17 00:43:49 -05:00
Wes Cossick
e6ab126431 Fix Esc key not exiting full screen properly; Fixes #99 2015-09-17 00:42:31 -05:00
Wes Cossick
2f6af67480 parsingConfig documentation 2015-09-17 00:40:57 -05:00
Wes Cossick
53910de1f9 Re-add paper theme 2015-09-16 23:20:37 -05:00
Wes Cossick
32cab53986 Merge pull request #103 from brondsem/getstate_code
Add getState() support for code
2015-09-14 13:28:48 -05:00
Dave Brondsema
ab83c5a5f6 Add getState() support for code (and yes, CodeMirror intenrally labels it as "comment") 2015-09-14 18:16:58 +00:00
arduanov
23359590df Fix autosave
After submit form with autosave we have emty string in local storage.
We won't set empty string instead of default form content.
2015-09-14 11:46:22 +05:00
Wes Cossick
1c369a3cc9 Dist file update 2015-09-12 02:22:54 -05:00
Wes Cossick
5ff5766ea6 Add parsingConfig option, TODO document 2015-09-12 02:03:49 -05:00
Wes Cossick
7f4491edee Merge proposed PRs for CodeMirror 2015-09-12 02:03:49 -05:00
Wes Cossick
f77dbc6aab Update/download dependencies 2015-09-12 02:03:49 -05:00
Wes Cossick
c9db36af67 gulp.js now auto downloads dependencies 2015-09-12 02:03:49 -05:00
Wes Cossick
2fd52aa629 Merge pull request #93 from brondsem/start_end_same
Don't increment both start and end points if they are the same object
2015-09-10 17:11:38 -05:00
Dave Brondsema
646002bff7 Don't increment both start and end points if they are the same object (e.g. no selection) 2015-09-10 21:54:41 +00:00
Wes Cossick
98aa67881d Fix error found in #91 2015-09-10 01:29:00 -05:00
Wes Cossick
f14c5f446f previewRender now supports async too 2015-09-05 14:28:50 -05:00
Wes Cossick
08c9d89662 Fix toolbar height again 2015-09-05 14:17:59 -05:00
Wes Cossick
4213ec606a Fix toolbar height bug in fullscreen 2015-09-05 14:13:41 -05:00
Wes Cossick
b4dc058bc0 Convert ' to " 2015-09-04 10:32:47 -05:00
Wes Cossick
83718f7f99 Merge pull request #84 from LulzAugusto/ReadmeImprovements
Readme improvements
2015-09-04 10:32:24 -05:00
Luiz Augusto Crisostomo
de01fb33bc Fixed "numbered-list" name. Added a hint about how to programmatically set the value. 2015-09-04 10:56:10 -03:00
Wes Cossick
06134ae5ef Link to npm page 2015-09-03 18:09:00 -05:00
Wes Cossick
cb13106671 Update version number on dist files 2015-09-03 18:06:14 -05:00
Wes Cossick
7223c32ce8 1.7.1 2015-09-03 18:04:10 -05:00
Wes Cossick
6c5a0dbc67 Regenerate dist files 2015-09-03 18:01:47 -05:00
Wes Cossick
8dd6262274 Simplified previewRender option 2015-09-03 17:59:50 -05:00
Wes Cossick
2737ab0808 Make README more clear 2015-09-03 17:40:28 -05:00
Wes Cossick
d4e5b77a8f Updates to custom preview rendering, Gulp dist files 2015-09-03 17:37:44 -05:00
Wes Cossick
eec0f55969 Merge pull request #82 from brondsem/pluggable_preview_func
Make preview rendering be customizable
2015-09-03 17:09:05 -05:00
Dave Brondsema
03aa254d99 Add preview_render README example js 2015-09-03 19:39:18 +00:00
Wes Cossick
e291f79bd2 Merge pull request #83 from brondsem/no_active_style_when_toolbar_disabled
Negate the active styling of buttons when in preview mode
2015-09-03 12:49:09 -05:00
Dave Brondsema
fe1f2a8d4f Negate the active styling of buttons when in preview mode 2015-09-03 17:27:49 +00:00
Dave Brondsema
f0f496ae92 Make preview rendering be customizable 2015-09-02 20:43:46 +00:00
Wes Cossick
4240da87c0 Merge pull request #81 from NextStepWebs/development
Document npm install in README
2015-09-02 10:50:32 -05:00
Wes Cossick
6389777c30 Document npm install in README 2015-09-02 10:50:10 -05:00
Wes Cossick
fbf4af9c73 Merge pull request #80 from NextStepWebs/development
New side-by-side previewing, Better line break handling, Heading icon improvements, New icons, Mobile improvements
2015-09-02 10:31:16 -05:00
Wes Cossick
8ed562431a Compress and prettify 2015-09-02 10:23:15 -05:00
Wes Cossick
35afb015a3 Mobile: Should prevent scroll behind fullscreen 2015-09-02 01:21:48 -05:00
Wes Cossick
e9d4205731 Mobile: Fade edges of fullscreen toolbar 2015-09-02 01:09:02 -05:00
Wes Cossick
8c32586d73 Mobile: Hide side-by-side preview 2015-09-02 00:46:23 -05:00
Wes Cossick
d74bf5def3 Recompile and prettify 2015-09-01 22:38:00 -05:00
Wes Cossick
eb1a43e91c Update preview image again 2015-09-01 22:36:05 -05:00
Wes Cossick
c07cd0c5f2 Update preview image 2015-09-01 22:33:40 -05:00
Wes Cossick
eba5e8a77d Better bigger/smaller heading icons 2015-09-01 20:35:51 -05:00
Wes Cossick
afa0101e68 Better element option behavior according to #79 2015-09-01 20:31:32 -05:00
Wes Cossick
8218391cfd Gulp now pretty formats JS and CSS 2015-09-01 20:26:52 -05:00
Wes Cossick
b43b99e50d Begin testing gulp-beautify 2015-09-01 13:32:57 -05:00
Wes Cossick
1ccc5b434f Update minified files 2015-09-01 01:42:04 -05:00
Wes Cossick
f6a8909c8f Update to v1.7.0 2015-09-01 01:40:58 -05:00
Wes Cossick
866488b0a9 Brand new side-by-side preview mode 2015-09-01 01:40:33 -05:00
Wes Cossick
41c551c115 Add new icon option: Strikethrough 2015-09-01 00:51:40 -05:00
Wes Cossick
db6d381d1c Three new heading icons, Fix heading button bugs 2015-09-01 00:40:11 -05:00
Wes Cossick
8311c8431b Fix toolbar button shift issue 2015-09-01 00:00:06 -05:00
Wes Cossick
cbeb630a97 Add singleLineBreaks option 2015-08-31 23:53:32 -05:00
Wes Cossick
405b99ae92 Fix typo, Mention GFM 2015-08-31 23:30:55 -05:00
Wes Cossick
2a32e619a4 Update Markdown options to use GFM line breaks 2015-08-31 23:29:11 -05:00
Wes Cossick
2b33f91495 Merge pull request #72 from NextStepWebs/development
Fix typo
2015-08-31 12:36:37 -05:00
Wes Cossick
06867c9ea9 Fix typo 2015-08-31 12:36:25 -05:00
Wes Cossick
25bbed7ae8 Merge pull request #67 from NextStepWebs/development
Update dist files to 1.6.1
2015-08-28 17:08:15 -05:00
Wes Cossick
74d7519e87 Update dist files to 1.6.1 2015-08-28 17:07:58 -05:00
Wes Cossick
20cdb4e3fe Merge pull request #66 from NextStepWebs/development
Add dist files
2015-08-28 13:40:54 -05:00
Wes Cossick
d4424f1b1a Add dist files 2015-08-28 13:40:27 -05:00
Wes Cossick
1d69c335c4 Merge pull request #65 from NextStepWebs/development
Toolbar icon improvements, Fullscreen improvements, Bug fixes
2015-08-28 13:27:51 -05:00
Wes Cossick
f0679a4154 Update CodeMirror to 5.6.x 2015-08-28 13:16:31 -05:00
Wes Cossick
8923a35891 Update package version 2015-08-25 20:59:54 -05:00
Wes Cossick
28d97ab644 Change dependencies to devDependencies 2015-08-25 20:59:04 -05:00
Wes Cossick
f9ba981b35 Bold the demo link 2015-08-18 09:16:55 -05:00
Wes Cossick
5814696678 Capitalize all "Markdown" references 2015-08-18 09:16:02 -05:00
Wes Cossick
1ce94de95a Improve introduction 2015-08-18 09:15:04 -05:00
Wes Cossick
0d730ead05 Tweak wording of toolbar icons 2015-08-18 08:39:17 -05:00
Wes Cossick
daf2c453f6 Update built in toolbar buttons 2015-08-18 08:37:42 -05:00
Wes Cossick
6cf9161034 Update default buttons 2015-08-18 08:36:09 -05:00
Wes Cossick
4a6d21ea1d Merge pull request #59 from fraserredmond/development
Added defaults for more toolbar buttons
2015-08-18 08:25:42 -05:00
Fraser Redmond
d60d0cd80d Added defaults for more toolbar buttons 2015-08-18 10:06:00 +01:00
Wes Cossick
ff48a879ea Simplified toolbar variant 2015-08-17 16:34:05 -05:00
Wes Cossick
ebabe1c48b Improve fullscreen, fix responsiveness 2015-08-17 16:06:04 -05:00
Wes Cossick
10ee1e70b5 Fix bug where toolbar height would leave gap 2015-08-17 15:53:35 -05:00
Wes Cossick
438b3ef531 Update CodeMirror Spell Checker to v1.0.5 2015-08-17 15:30:17 -05:00
Wes Cossick
8754f008fd New heading icon: Update README / tweak code 2015-08-14 14:07:36 -05:00
Wes Cossick
ee471abde9 Merge pull request #53 from fraserredmond/master
Heading 1-6
2015-08-14 13:06:03 -05:00
Wes Cossick
50bb35d057 Merge pull request #52 from NextStepWebs/development
Create CONTRIBUTING.md
2015-08-12 15:59:09 -05:00
Wes Cossick
02ef20ba23 Create CONTRIBUTING.md 2015-08-12 15:58:59 -05:00
Fraser Redmond
0f9dd5ee56 Heading 1-6 2015-08-12 17:23:09 +01:00
Wes Cossick
e96376c9b1 Merge pull request #48 from NextStepWebs/development
Tweak README
2015-08-11 23:25:45 -05:00
Wes Cossick
28bbe67223 Tweak README 2015-08-11 23:25:37 -05:00
Wes Cossick
343b4a8027 Merge pull request #46 from NextStepWebs/development
Restructure to use gulp.js, Value improvements, Fix bugs
2015-08-11 12:05:35 -05:00
Wes Cossick
c1967269b6 Format JS file 2015-08-11 12:04:59 -05:00
Wes Cossick
927879853f Update gulp and dist 2015-08-11 12:03:13 -05:00
Wes Cossick
60705ad0cc Minify dist files 2015-08-11 11:45:54 -05:00
Wes Cossick
10bbf55c6e Improve gulp implementation 2015-08-11 11:45:45 -05:00
Wes Cossick
00fa95823e Rename option defaultValue > initialValue 2015-08-11 11:26:46 -05:00
Wes Cossick
214045165c Update README to include new options 2015-08-11 11:26:24 -05:00
Wes Cossick
e84f985e3d Merge pull request #45 from frmendes/development
Adds Gulpfile and a few extra options
2015-08-11 11:04:02 -05:00
Fernando Mendes
f2504d2dfc Updates CSS files to the most recent version 2015-08-11 16:57:32 +01:00
Fernando Mendes
dbeef5d711 Adds basic package.json file 2015-08-11 16:34:14 +01:00
Fernando Mendes
b334fc3804 Removes node_modules 2015-08-11 16:29:13 +01:00
Fernando Mendes
7ba6bf8dbe Updates gulpfile and syncs with base repo 2015-08-11 16:27:11 +01:00
Marcos Piccinini
3550aef98d minify & uglify 2015-08-11 16:23:00 +01:00
Marcos Piccinini
de7f1a8d11 add css 2015-08-11 16:22:49 +01:00
Marcos Piccinini
2a2a63aac2 add missing fullscreen.js 2015-08-11 16:22:49 +01:00
Marcos Piccinini
e04e75a1fa Pasted quickly, sorry. 2015-08-11 16:22:49 +01:00
Marcos Piccinini
2cffd6cae5 Fix gulpfile, add fullscreen.js 2015-08-11 16:22:49 +01:00
Fernando Mendes
d02aa31c23 Small fix 2015-08-11 16:22:48 +01:00
Fernando Mendes
8e877a70d8 Updates gulpfile 2015-08-11 16:22:47 +01:00
Fernando Mendes
154723e058 Updates project structure to match gulpfile 2015-08-11 16:22:47 +01:00
Fernando Mendes
138d1a80e3 Adds gulpfile and updates gitignore 2015-08-11 16:22:16 +01:00
Fernando Mendes
709a51af19 Accepts blank test in editor value getter/setter 2015-08-11 16:22:16 +01:00
Fernando Mendes
586f49d64a Renames source folder, creates dist folder 2015-08-11 16:20:44 +01:00
Jon Moss
613cdcaf0b Update Readme docs
Adding element rendered the editor; otherwise editor wouldn't render for me.
2015-08-11 16:19:25 +01:00
Wes Cossick
b55fef85ae Tweak formatting of README code 2015-08-11 10:06:34 -05:00
Wes Cossick
14b1bd023c Restructure repo 2015-08-11 10:05:41 -05:00
Wes Cossick
2f6335e640 Fix bugs: preview/fullscreen with multiple editors on same page 2015-08-11 10:00:14 -05:00
Wes Cossick
91095a93d5 Fix issues with fullscreen appearance 2015-08-11 09:59:26 -05:00
Wes Cossick
4d6194b09c Merge pull request #41 from NextStepWebs/development
Fullscreen mode, Update dependencies, Bug fixes
2015-08-08 15:42:27 -05:00
Wes Cossick
8a892d4b78 Minified files 2015-08-08 15:40:43 -05:00
Wes Cossick
022ccfd315 Fix previewing sizing bug inadvertently caused 2015-08-08 15:40:34 -05:00
Wes Cossick
1d263cabb9 Tweak README toolbar table 2015-08-08 15:10:49 -05:00
Wes Cossick
d8ad2959a8 Fix fullscreen icon not remaining active 2015-08-08 15:00:01 -05:00
Wes Cossick
67b1ac7ca8 Update spell checker dependency 2015-08-08 14:59:47 -05:00
Wes Cossick
dd85947668 Fix cursor position issue in #39 2015-08-08 14:59:37 -05:00
Wes Cossick
9af8929945 Update documentation 2015-08-08 13:15:14 -05:00
Wes Cossick
fc6fd13025 Support fullscreen (including new toolbar button) 2015-08-08 13:14:04 -05:00
Wes Cossick
1aad2dec4c Fix toolbar overwrite issue 2015-08-07 16:32:53 -05:00
Wes Cossick
c75bf94de8 Update dependencies 2015-08-07 16:20:05 -05:00
Wes Cossick
0eb0a94ba0 Merge pull request #34 from NextStepWebs/development
Spell checking, Update dependencies, Fix bugs
2015-07-20 23:32:54 -05:00
Wes Cossick
72a2b011d6 Minified versions 2015-07-20 23:31:05 -05:00
Wes Cossick
9d4c6a63e4 New! Spell checking support 2015-07-20 23:26:47 -05:00
Wes Cossick
7db42a36c2 Update to CodeMirror 5.5.1 2015-07-20 22:27:04 -05:00
Wes Cossick
c7dd040ed3 More reliable tabbing, fixes bug in Firefox
Closes issue #30
2015-07-20 22:19:39 -05:00
Wes Cossick
383c7fdb9e Merge pull request #33 from NextStepWebs/development
Update README.md
2015-07-20 11:52:17 -05:00
Wes Cossick
c8b908fd0e Update README.md 2015-07-20 11:51:58 -05:00
Wes Cossick
bb24da9480 Merge pull request #32 from NextStepWebs/development
JavaScript highlighting in README
2015-07-20 11:49:56 -05:00
Wes Cossick
1227bb6abd JavaScript highlighting in README 2015-07-20 11:49:47 -05:00
Wes Cossick
5e68508600 Merge pull request #27 from NextStepWebs/development
Tweak capitalization
2015-07-15 23:55:06 -05:00
Wes Cossick
b1e045f5b1 Tweak capitalization 2015-07-15 23:54:54 -05:00
Wes Cossick
d3531410ad Merge pull request #26 from maclover7/patch-1
Update Readme docs
2015-07-15 10:21:29 -05:00
Jon Moss
dbf3b5a3d4 Update Readme docs
Adding element rendered the editor; otherwise editor wouldn't render for me.
2015-07-15 11:08:01 -04:00
Wes Cossick
c9eb0a479d Merge pull request #25 from NextStepWebs/development
Use GitHub flavored markdown
2015-07-14 16:13:41 -05:00
Wes Cossick
72fdf40d3d Minified file 2015-07-14 16:12:34 -05:00
Wes Cossick
619d5dad4c Add notice to gfm.js 2015-07-14 16:12:28 -05:00
Wes Cossick
2a2aa7c36d Update compile README 2015-07-14 16:12:22 -05:00
Wes Cossick
d61280d03d Use GitHub flavored markdown 2015-07-14 16:07:56 -05:00
Wes Cossick
ebf32d01fa Merge pull request #24 from NextStepWebs/development
Fix README inaccuracy
2015-07-14 12:58:50 -05:00
Wes Cossick
5ba95f1ba6 Fix README inaccuracy 2015-07-14 12:58:28 -05:00
Wes Cossick
148721ee1f Merge pull request #23 from NextStepWebs/development
Tooltips, Expanded icons, Guide, Bug fixes
2015-07-14 12:54:59 -05:00
Wes Cossick
94d02639f9 Minified files 2015-07-14 12:54:33 -05:00
Wes Cossick
fcea866fb4 Setting to disable toolbar guide icon 2015-07-14 12:43:33 -05:00
Wes Cossick
474b576521 Add horizontal rule button 2015-07-14 12:34:22 -05:00
Wes Cossick
888165a9fe Fix a bug 2015-07-14 12:24:42 -05:00
Wes Cossick
148a3efadf Add code block to README 2015-07-14 12:24:37 -05:00
Wes Cossick
54a47f3dbc Fix selection issue with code blocks 2015-07-14 12:03:33 -05:00
Wes Cossick
fa7ef0310e Tweak README for readability 2015-07-14 11:55:42 -05:00
Wes Cossick
096f6e9a6d Fix bug creating icons 2015-07-14 11:54:40 -05:00
Wes Cossick
d05106a0ed Customize toolbar, Document this in README 2015-07-14 11:52:28 -05:00
Wes Cossick
6c3baad29b Add help icon, Add shortcut note to tooltip, Add preview shortcut 2015-07-14 11:31:45 -05:00
Wes Cossick
5c4ca1f01a Merge pull request #22 from jetmind/patch-1
Fix instructions to change min-height
2015-07-14 11:17:25 -05:00
Igor Bondarenko
20d66d9a23 Fix instructions to change min-height
If you set `min-height` to value less than default 300px, you'll need to set it on `.CodeMirror-scroll` also for it to work.
2015-07-14 13:54:18 +03:00
Wes Cossick
8f1c54b7dd toolbarTips option added 2015-07-14 00:47:34 -05:00
Wes Cossick
c089fc5753 Title attributes added to toolbar buttons 2015-07-14 00:40:36 -05:00
Wes Cossick
bbcff529ec Merge pull request #21 from NextStepWebs/development
Add event handling to README
2015-07-11 10:09:33 -05:00
Wes Cossick
1c1f3fdecd Add event handling to README 2015-07-11 10:09:02 -05:00
Wes Cossick
8b3512cd02 Merge pull request #15 from NextStepWebs/development
Rename source file markdownify.js > simplemde.js
2015-07-08 10:25:28 -05:00
Wes Cossick
4a2a06c642 Rename source file markdownify.js > simplemde.js 2015-07-08 10:24:46 -05:00
Wes Cossick
7223c23cdc Merge pull request #11 from NextStepWebs/development
READEME: Small tweaks
2015-07-05 21:47:03 -05:00
Wes Cossick
2090a9e553 Fix grammar typo 2015-07-05 21:46:25 -05:00
Wes Cossick
1229ea0224 Include note about delay with jsDelivr 2015-06-27 20:12:13 -05:00
Wes Cossick
f69c39f5ad Merge pull request #10 from NextStepWebs/development
Fix autosave issue
2015-06-27 14:31:27 -05:00
Wes Cossick
a772676b78 Bug Fix: Issue with autosave not finding saved text 2015-06-27 14:28:47 -05:00
Wes Cossick
e072698b78 Added a what's changed point 2015-06-26 16:22:23 -05:00
Wes Cossick
47132fc20a Merge pull request #9 from NextStepWebs/development
Autosaving, More options, Split out Font Awesome, Fix bugs
2015-06-26 16:20:26 -05:00
Wes Cossick
03da7bb02c Minified versions 2015-06-26 16:11:37 -05:00
Wes Cossick
ae624852e0 Now there's a note in the status bar for autosaves 2015-06-26 16:04:14 -05:00
Wes Cossick
c347811e29 Update Marked to 0.3.3 2015-06-26 15:41:21 -05:00
Wes Cossick
83722ff7b2 Update to CodeMirror 5.4.1 2015-06-26 15:39:33 -05:00
Wes Cossick
f0a2255870 Tweak readme text 2015-06-26 15:36:38 -05:00
Wes Cossick
b02d5dc612 Add text to readme code 2015-06-26 15:35:24 -05:00
Wes Cossick
121726ff01 Tweak the readme woding 2015-06-26 15:34:45 -05:00
Wes Cossick
6969064b7c Basic autosave functionality 2015-06-26 15:33:28 -05:00
Wes Cossick
cac8f44891 Update readme again 2015-06-26 14:47:52 -05:00
Wes Cossick
91c9b9cb22 Update readme with another option for status 2015-06-26 14:47:20 -05:00
Wes Cossick
21f3424822 Huge improvement to tabbing
Now respects tab size, Now respects indent with tab, Now allows tabbing
lists, Now allows shift-tabbing lists
2015-06-26 14:44:39 -05:00
Wes Cossick
6c91d90763 Fix variable type 2015-06-26 14:44:01 -05:00
Wes Cossick
3535ee7cd7 Fix README variable type 2015-06-26 14:43:46 -05:00
Wes Cossick
6e17a82530 Disallow line numbers
CSS is all messed up - could be a future enhancement.
2015-06-26 14:09:17 -05:00
Wes Cossick
bcf70a53df Fix line wrapping (wasn't disabling) 2015-06-26 14:07:31 -05:00
Wes Cossick
aeb86dd418 Fix two inconsistencies with the documentation 2015-06-26 14:01:02 -05:00
Wes Cossick
d11ecf7eb0 Tweak readme text 2015-06-26 14:00:45 -05:00
Wes Cossick
7eb1bdc0cb Change the color coding 2015-06-26 13:55:23 -05:00
Wes Cossick
8c9cb5c90d Add .gitignore 2015-06-26 13:54:22 -05:00
Wes Cossick
fd3983ff29 Update readability again 2015-06-26 13:54:04 -05:00
Wes Cossick
c45ada1c6b Updates to README 2015-06-26 13:52:19 -05:00
Wes Cossick
4ae1aa3874 Many new options during instantiation 2015-06-26 12:53:24 -05:00
Wes Cossick
9999fd93c1 Fix bug with toolbar not hiding 2015-06-26 12:45:54 -05:00
Wes Cossick
958e3c08c7 Split Font Awesome out
This way, if a user is already using Font Awesome, there's no need to
redownload the CSS.
2015-06-26 12:40:59 -05:00
Wes Cossick
d1da791320 Remove "Short description of image"
It's easier if users don't even know that's a possibility, honestly.
2015-06-26 12:36:31 -05:00
Wes Cossick
d3f528accb Make tables clearer in the preview 2015-06-22 21:41:24 -05:00
Wes Cossick
54de199813 Merge pull request #8 from NextStepWebs/development
Add comments to top of distribution files
2015-06-22 21:32:45 -05:00
Wes Cossick
c190cf0946 Add comment with version at top 2015-06-22 21:31:31 -05:00
Wes Cossick
2634910dfd Update README.md 2015-06-22 21:30:04 -05:00
Wes Cossick
31e71766de Merge pull request #7 from NextStepWebs/development
Fix bug that broke bold and italics
2015-06-22 21:25:59 -05:00
Wes Cossick
78e8c0b2cd Update README.md 2015-06-22 21:25:45 -05:00
Wes Cossick
c3b3300bcb Fix bug that broke bold and italics 2015-06-22 21:24:57 -05:00
Wes Cossick
da448e733e Update README.md 2015-06-22 20:48:38 -05:00
Wes Cossick
1c105115dd Merge pull request #6 from NextStepWebs/development
Disabled toolbar buttons during preview, Fix bugs
2015-06-22 20:28:27 -05:00
Wes Cossick
07479c7f02 Fix bug with className 2015-06-22 20:25:31 -05:00
Wes Cossick
5790ab6c54 Deactivate toolbar buttons on preview 2015-06-22 20:18:07 -05:00
Wes Cossick
590dbe5c9a Update scroll section min-height 2015-06-22 17:34:53 -05:00
Wes Cossick
5bfb593c64 Merge pull request #4 from NextStepWebs/development
Update URLs
2015-06-22 17:28:01 -05:00
Wes Cossick
26a7619873 Update URLs 2015-06-22 17:27:45 -05:00
Wes Cossick
da39266d3d Update README.md 2015-06-22 16:53:42 -05:00
Wes Cossick
0ed8e356cd Merge pull request #3 from NextStepWebs/development
Really fix CSS problems
2015-06-22 16:53:28 -05:00
Wes Cossick
18035dddbb Allow for auto merge 2015-06-22 16:52:50 -05:00
Wes Cossick
f6d7b6da42 Revert "Revert "Really fix CSS problems""
This reverts commit 612e347c3272328365daec3a6ed236f354f997d4.
2015-06-22 16:52:24 -05:00
Wes Cossick
612e347c32 Revert "Really fix CSS problems"
This reverts commit 400ddfa299bd73f1d5d640abdab3820969d09b90.
2015-06-22 16:51:56 -05:00
Wes Cossick
400ddfa299 Really fix CSS problems 2015-06-22 16:50:52 -05:00
Wes Cossick
aa7ce73fbf Update README.md 2015-06-22 16:36:35 -05:00
Wes Cossick
7c78a866cf Merge pull request #2 from NextStepWebs/development
Fix compiled CSS
2015-06-22 16:35:34 -05:00
Wes Cossick
66c62a3ea3 Fix compiled CSS 2015-06-22 16:35:08 -05:00
Wes Cossick
801f9c52fb Fix small typos 2015-06-22 16:20:48 -05:00
Wes Cossick
a9499c5c91 Update README.md 2015-06-22 16:04:58 -05:00
Wes Cossick
7466d72c02 Merge pull request #1 from NextStepWebs/development
Update README to use jsDelivr
2015-06-22 16:02:55 -05:00
Wes Cossick
968a8e13b3 Update README to use jsDelivr 2015-06-22 16:02:26 -05:00
Wes Cossick
da30c7f08f Fix issue with selection after deselecting italic 2015-06-22 15:52:28 -05:00
Wes Cossick
df988b2f54 Tidy theme.css up 2015-06-22 15:42:58 -05:00
Wes Cossick
d3c2661e7f Rename class to SimpleMDE 2015-06-22 15:26:05 -05:00
Wes Cossick
2090a8f252 Rename to SimpleMDE 2015-06-22 15:12:04 -05:00
Wes Cossick
75b93bd3ed Update README.md 2015-06-22 15:02:45 -05:00
Wes Cossick
2b4fbc27b8 Update README.md 2015-06-22 15:01:44 -05:00
52 changed files with 23998 additions and 14022 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
[*.yaml]
indent_size = 2
[*.md]
max_line_length = off
trim_trailing_whitespace = false

27
.eslintrc Normal file
View File

@ -0,0 +1,27 @@
{
"root": true,
"rules": {
"strict": 0,
"no-console": 0,
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"comma-dangle": [
"error",
"always-multiline"
]
},
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2018
},
"extends": "eslint:recommended"
}

13
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,13 @@
<!-- Please help me process issues faster by providing the following information -->
### I'm submitting a...
- [x] Bug report
- [ ] Feature request
### Reproduction steps
<!-- Bonus points if you set up a [JSFiddle](https://jsfiddle.net/) that replicates the bug and link it in the issue. -->
1. ...
2. ...
### Version information
Browser type and version:
EasyMDE version:

32
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Version information**
- OS: [e.g. Windows, MacOS]
- Browser: [e.g. Chrome 72]
- EasyMDE version: [e.g. 2.5.1]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots/mock-ups about the feature request here.

11
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@ -0,0 +1,11 @@
---
name: Question
about: Ask a question if anything is unclear
title: ''
labels: Question
assignees: ''
---
**Describe your question**
Please describe your question in as much detail as possible.

95
.github/workflows/cd.yaml vendored Normal file
View File

@ -0,0 +1,95 @@
name: Test & Deploy
on:
workflow_dispatch:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: current
- uses: actions/checkout@v4
- run: npm audit --omit=dev
test:
needs: [ audit ]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '14', '16', '18' ]
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
- run: npm ci
- name: Test
run: npm test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots-nodejs-${{ matrix.node-version }}
path: cypress/screenshots
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos-nodejs-${{ matrix.node-version }}
path: cypress/videos
retention-days: 7
deploy:
needs: [ test ]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/setup-node@v4
with:
node-version: current
- uses: actions/checkout@v4
- run: npm ci
- name: Deploy @latest version to npm
if: startsWith(github.ref, 'refs/tags/')
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Update @next version
if: startsWith(github.ref, 'refs/heads/')
run: npm version prerelease --no-git-tag-version --preid "$GITHUB_RUN_NUMBER"
- name: Deploy @next version to npm
if: startsWith(github.ref, 'refs/heads/')
uses: JS-DevTools/npm-publish@v1
with:
tag: next
token: ${{ secrets.NPM_TOKEN }}
check-version: false

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# generated files
dist/
# NPM files
node_modules/
# IDE files
*.iml
*.ipr
*.iws
.idea/
.vscode/
dev_test/
# Test artifacts
cypress/screenshots
cypress/videos

1
.npmrc Normal file
View File

@ -0,0 +1 @@
tag-version-prefix=""

478
CHANGELOG.md Normal file
View File

@ -0,0 +1,478 @@
# EasyMDE Changelog
All notable changes to EasyMDE will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
<!-- ## [Unreleased] -->
## [2.20.0] - 2025-03-04
### Added
- Support for `marked` extensions (Thanks to [@codingjoe], [#611], [#514]).
## [2.19.0] - 2025-02-18
### Added
- `updateStatusBar` type to typescript definitions (Thanks to [@borodean], [#519]).
- `"upload-image"` option to the `ToolbarButton` typescript definitions (Thanks to [@borodean], [#520]).
- `imageInputName` option to set a custom "name" attribute for the image input (Thanks to [@robinvandernoord], [#573]).
### Fixed
- Relative image paths using the stylesheet as the source instead of the document (Thanks to [@p1gp1g], [#591]).
- Excessive memory usage with the `previewImagesInEditor` option (Thanks to [@p1gp1g], [#592]).
- Parentheses in the alt text of images causing the image not to load then using `previewImagesInEditor` (Thanks to [@mayraamaral], [#608]).
## [2.18.0] - 2022-09-20
### Added
- `toolbarButtonClassPrefix` option to resolve conflicts with Bootstrap classes ([#493]).
## [2.17.0] - 2022-08-20
### Added
- Improved CSRF support for uploading images (Thanks to [@ZsgsDesign], [#394]).
- Option to register an image preview handler: `imagesPreviewHandler` (Thanks to [@diego-gw], [#411]).
- Support for `.webp` image formats (Thanks to [@sghoweri], [#417]).
- `toggleHeading` methods for headings 4, 5 and 6 (Thanks to [@vanillajonathan], [#449] and [#492]).
- Support for `.gif`, `.avif` and `.apng` image formats (Thanks to [@vanillajonathan], [#450], [#458] and [#459]).
- Keyboard shortcuts for `toggleHeading` methods (Thanks to [@vanillajonathan], [#451]).
- `iconClassMap` option to specify icon class names for toolbar buttons (Thanks to [@vanillajonathan], [#454]).
- `role="toolbar"` on the toolbar element (Thanks to [@vanillajonathan], [#455]).
- Support for text buttons in the toolbar (Thanks to [@vanillajonathan], [#461]).
- `aria-label` attribute for toolbar buttons (uses the `title` option) (Thanks to [@vanillajonathan], [#463]).
- `role="application"` on the editor container element (Thanks to [@vanillajonathan], [#464]).
- Option to not overwrite the preview HTML by returning `null` from `previewRender` (Thanks to [@LevitatingOrange], [#471]).
### Fixed
- Hyperlink doubling (Thanks to [@danielok1993], [#95]).
- URLs with certain characters entered through prompts causing invalid markdown (Thanks to [@Zignature], [#393]).
- Autofocus option not working properly ([#399]).
- Inconsistent border colour (Thanks to [@vanillajonathan], [#466]).
- Invalid regex on Safari browsers ([#478])
- `hideIcons` option type (Thanks to [@LoyalPotato], [#488]).
### Changed
- Editor now uses responsive font sizes (Thanks to [@vanillajonathan], [#452]).
### Documentation
- Added several improvements to README (Thanks to [@vanillajonathan], [#436], [#438], [#440], [#444]).
- Fixed typo in README (Thanks to [@kicksent], [#484]).
- Added missing icon for `upload-image` in README (Thanks to [@hlf20010508], [#486]).
## [2.16.1] - 2022-01-14
### Fixed
- Incorrect initial line and column count in status bar.
- Security issue in `marked` dependency.
## [2.16.0] - 2022-01-11
### Added
- `direction` option to enable RTL mode (Thanks to [@souljuse], [#358]).
- `attributes` option to add custom attributes to toolbar buttons (Thanks to [@Zignature], [#388]).
- `unorderedListStyle` option to change the character used for unordered lists (Thanks to [@Zignature], [#389]).
### Fixed
- Image extension detection when extension is uppercase (Thanks to [@ukjinjang], [#357]).
- Submenu actions not working in Chromium Browsers (Thanks to [@Offerel], [@robjean9] and [@kelvinj], [#364]).
- Incorrect line and column count in status bar (Thanks to [@Zignature], [#384]).
## [2.15.0] - 2021-04-22
### Added
- `imagePathAbsolute` option to return the absolute path when uploading an image (Thanks to [@wwsalmon], [#313]).
### Fixed
- `ToolbarIcon` typings, added `icon` (Thanks to [@ChronosMasterOfAllTime], [#308]).
- Image link extension when it was not the last part of the URL (Thanks to [@deerboy], [#311]).
- Preview mode did not stay enabled when toggling to fullscreen (Thanks to [@smundro], [#316]).
- Required typings not being included in `dependencies` (Thanks to [@marekdedic], [#322]).
## [2.14.0] - 2021-02-14
### Added
- The `scrollbarStyle` option to change the style of the scrollbar (Thanks to [@danice], [#250]).
### Fixed
- Issues with images not displaying correctly in the preview screen (Thanks to [@ivictbor], [#253]).
- An error when both `sideBySideFullscreen` and `status` were set to `false` (Thanks to [@joahim], [#272]).
- Editor trying to display non-image files (Thanks to [@Juupaa], [#277])
- Unneeded call to `window.removeEventListener` (Thanks to [@emirotin], [#280])
- Spell checker (Thanks to [@Fanvadar], [#284]).
- Focus issues with toolbar dropdown menus (Thanks to [@Situphen], [#285]).
- Interaction between the `sideBySideFullscreen` and the preview state (Thanks to [@smundro], [#286])
- Refactored strange method of padding the toolbar into regular padding (Thanks to [@sn3p], [#293]).
- Security issue in `marked` dependency (Thanks to [@dependabot], [#298]).
## [2.13.0] - 2020-11-11
### Added
- CodeMirror autorefresh plugin and autoRefresh option (Thanks to [@mbolli], [#249]).
- `lineNumbers` option to display line numbers in the editor (Thanks to [@nhymxu], [#267]).
### Fixed
- CSS scoping issues when the editor is used in combination with other CodeMirror instances ([#252]).
## [2.12.1] - 2020-10-06
### Changed
- Set `previewImagesInEditor` option to `false` by default ([#251]).
## [2.12.0] - 2020-09-29
### Added
- `this` context in imageUploadFunction (Thanks to [@JoshuaLicense], [#225]).
- `previewImagesInEditor` option to display images in editor mode (Thanks to [@ivictbor], [#235]).
- `overlayMode` options to supply an additional codemirror mode (Thanks to [@czynskee], [#244]).
### Fixed
- Corrected default size units from `b,Kb,Mb` to ` B, KB, MB` ([#239]).
- Max height less than min height (Thanks to [@nick-denry], [#222]).
- toTextArea issue (Thanks to [@nick-denry], [#223]).
- Error when updateStatusBar was called during image upload, but the status bar is disabled (Thanks to [@JoshuaLicense], [#224]).
## [2.11.0] - 2020-07-16
### Added
- Support for Node.js 14.
- Preview without fullscreen (Thanks to [@nick-denry], [#196]).
### Fixed
- Fix cursor displayed position on activity (Thanks to [@firm1], [#184]).
- Checkboxes always have bullets in front of them ([#136]).
- Save the text only when modifying the content of the easymde instance (Thanks to [@firm1], [#181]).
## [2.10.1] - 2020-04-06
### Fixed
- Typescript error when entering certain strings for toolbar buttons ([#178]).
## [2.10.0] - 2020-04-02
### Added
- `inputStyle` and `nativeSpellcheck` options to manage the native language of the browser (Thanks to [@firm1], [#143]).
- Group buttons in drop-down lists by adding a sub-option `children` for the items in the toolbar (Thanks to [@firm1], [#141]).
- `sanitizerFunction` option to allow custom HTML sanitizing in the markdown preview (Thanks to [@adamb70], [#147]).
- Time formatting and custom text options for the autosave message (Thanks to [@dima-bzz], [#170]).
### Changed
- Delay before assuming that submit of the form as failed is `autosave.submit_delay` instead of `autosave.delay` (Thanks to [@Situphen], [#139]).
- 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]).
- Editor displaying on top of other elements on a webpage (Thanks to [@StefKors], [#175]).
## [2.9.0] - 2020-01-13
### Added
- Missing minHeight option in type definition (Thanks to [@t49tran], [#123]).
- Other missing type definitions ([#126]).
### Changed
- The editor will remove its saved contents when the editor is emptied, allowing to reload a default value (Thanks to [@Situphen], [#132]).
## [2.8.0] - 2019-08-20
### Added
- Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]).
- Allow custom image upload function (Thanks to [@sperezp], [#106]).
- More polish to the upload images functionality (Thanks to [@jfly], [#109]).
- Improved React compatibility (Thanks to [@richtera], [#97]).
### Fixed
- Missing link in dist file header.
## [2.7.0] - 2019-07-13
### Added
- `previewClass` option for overwriting the preview screen class ([#99]).
### Fixed
- Updated dependencies to resolve potential security issue.
- Resolved small code style issues shown by new eslint rules.
## [2.6.1] - 2019-06-17
### Fixed
- Error when toggling between ordered and unordered lists (Thanks to [@roryok], [#93]).
- Keyboard shortcuts for custom actions not working (Thanks to [@ysykzheng], [#75]).
## [2.6.0] - 2019-04-15
### Added
- Contributing guide (Thanks to [@roipoussiere], [#54]).
- Issue templates.
- Standardized changelog file.
### Changed
- Finish rewrite of README (Thanks to [@roipoussiere], [#54]).
- Image and link prompt fill with "https://" by default.
- Link to markdown guide to <https://www.markdownguide.org/basic-syntax/>.
### Fixed
- Backwards compatibility in the API with SimpleMDE 1.0.0 ([#41]).
- Automatic publish of master branch to `@next`
### Removed
- Distribution files from source-control.
## [2.5.1] - 2019-01-17
### Fixed
- `role="button"` needed to be `type="button"` ([#45]).
## [2.5.0] - 2019-01-17
### Added
- Typescript support (Thanks to [@FranklinWhale], [#44]).
- `role="button"` to toolbar buttons ([#38]).
### Fixed
- Eraser icon not working with FontAwesome 5.
## [2.4.2] - 2018-11-09
### Added
- Node.js 11 support.
### Fixed
- Header button icons not showing sub-icons with FontAwesome 5.
- Inconsistent autosave behaviour when submitting a form (Thanks to [@Furgas] and [@adamb70], [#31]).
## [2.4.1] - 2018-10-15
### Added
- `fa-redo` class to redo button for FA5 compatibility (Thanks to [@Summon528], [#27]).
## [2.4.0] - 2018-10-15
### Added
- Theming support (Thanks to [@LeviticusMB], [#17]).
- onToggleFullscreen event hook (Thanks to [@n-3-0], [#16]).
### Fixed
- Fullscreen not working with `toolbar: false` (Thanks to [@aphitiel], [#19]).
## [2.2.2] - 2019-07-03
### Fixed
- Automatic publish only publishing tags.
## [2.2.1] - 2019-06-29
### Changed
- Attempt automatic publish `@next` version on npm.
- Links in the preview window will open in a new tab by default.
### Fixed
- Multi-text select issue by disabling multi-select in the editor ([#10]).
- `main` file in package.json (Thanks to [@sne11ius], [#11]).
## [2.0.1] - 2018-05-13
### Changed
- Rewrote part of the documentation for EasyMDE.
- Updated gulp to version 4.0.0.
### Fixed
- Icons for `heading-smaller`, `heading-bigger`, `heading-1`, `heading-2` and `heading-3` not showing ([#9]).
## [2.0.0] - 2018-04-23
Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown-editor)
### BREAKING CHANGES
- Dropped Bower support.
- Dropped support for older Node.js versions.
### Added
- FontAwesome 5 support.
- Support for newer Node.js versions.
### Changed
- Packages are now version-locked.
- Simplified build script.
- Markdown guide button is no longer disabled in preview mode.
### Fixed
- Cursor not always showing in "text" mode over the edit field
<!-- Linked issues -->
[#611]: https://github.com/Ionaru/easy-markdown-editor/issues/611
[#514]: https://github.com/Ionaru/easy-markdown-editor/issues/514
[#493]: https://github.com/Ionaru/easy-markdown-editor/issues/493
[#478]: https://github.com/Ionaru/easy-markdown-editor/issues/478
[#399]: https://github.com/Ionaru/easy-markdown-editor/issues/399
[#252]: https://github.com/Ionaru/easy-markdown-editor/issues/252
[#251]: https://github.com/Ionaru/easy-markdown-editor/issues/251
[#239]: https://github.com/Ionaru/easy-markdown-editor/issues/239
[#178]: https://github.com/Ionaru/easy-markdown-editor/issues/178
[#136]: https://github.com/Ionaru/easy-markdown-editor/issues/136
[#126]: https://github.com/Ionaru/easy-markdown-editor/issues/126
[#99]: https://github.com/Ionaru/easy-markdown-editor/issues/99
[#45]: https://github.com/Ionaru/easy-markdown-editor/issues/45
[#44]: https://github.com/Ionaru/easy-markdown-editor/issues/44
[#41]: https://github.com/Ionaru/easy-markdown-editor/issues/41
[#38]: https://github.com/Ionaru/easy-markdown-editor/issues/38
[#17]: https://github.com/Ionaru/easy-markdown-editor/issues/17
[#16]: https://github.com/Ionaru/easy-markdown-editor/issues/16
[#11]: https://github.com/Ionaru/easy-markdown-editor/issues/11
[#10]: https://github.com/Ionaru/easy-markdown-editor/issues/10
[#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9
<!-- Linked PRs -->
[#608]: https://github.com/Ionaru/easy-markdown-editor/pull/608
[#592]: https://github.com/Ionaru/easy-markdown-editor/pull/592
[#591]: https://github.com/Ionaru/easy-markdown-editor/pull/591
[#573]: https://github.com/Ionaru/easy-markdown-editor/pull/573
[#520]: https://github.com/Ionaru/easy-markdown-editor/pull/520
[#519]: https://github.com/Ionaru/easy-markdown-editor/pull/519
[#492]: https://github.com/Ionaru/easy-markdown-editor/pull/492
[#488]: https://github.com/Ionaru/easy-markdown-editor/pull/488
[#486]: https://github.com/Ionaru/easy-markdown-editor/pull/486
[#484]: https://github.com/Ionaru/easy-markdown-editor/pull/484
[#479]: https://github.com/Ionaru/easy-markdown-editor/pull/479
[#471]: https://github.com/Ionaru/easy-markdown-editor/pull/471
[#467]: https://github.com/Ionaru/easy-markdown-editor/pull/467
[#466]: https://github.com/Ionaru/easy-markdown-editor/pull/466
[#464]: https://github.com/Ionaru/easy-markdown-editor/pull/464
[#463]: https://github.com/Ionaru/easy-markdown-editor/pull/463
[#461]: https://github.com/Ionaru/easy-markdown-editor/pull/461
[#459]: https://github.com/Ionaru/easy-markdown-editor/pull/459
[#458]: https://github.com/Ionaru/easy-markdown-editor/pull/458
[#455]: https://github.com/Ionaru/easy-markdown-editor/pull/455
[#454]: https://github.com/Ionaru/easy-markdown-editor/pull/454
[#452]: https://github.com/Ionaru/easy-markdown-editor/pull/452
[#451]: https://github.com/Ionaru/easy-markdown-editor/pull/451
[#450]: https://github.com/Ionaru/easy-markdown-editor/pull/450
[#449]: https://github.com/Ionaru/easy-markdown-editor/pull/449
[#444]: https://github.com/Ionaru/easy-markdown-editor/pull/444
[#440]: https://github.com/Ionaru/easy-markdown-editor/pull/440
[#438]: https://github.com/Ionaru/easy-markdown-editor/pull/438
[#436]: https://github.com/Ionaru/easy-markdown-editor/pull/436
[#417]: https://github.com/Ionaru/easy-markdown-editor/pull/417
[#411]: https://github.com/Ionaru/easy-markdown-editor/pull/411
[#394]: https://github.com/Ionaru/easy-markdown-editor/pull/394
[#393]: https://github.com/Ionaru/easy-markdown-editor/pull/393
[#389]: https://github.com/Ionaru/easy-markdown-editor/pull/389
[#388]: https://github.com/Ionaru/easy-markdown-editor/pull/388
[#384]: https://github.com/Ionaru/easy-markdown-editor/pull/384
[#364]: https://github.com/Ionaru/easy-markdown-editor/pull/364
[#358]: https://github.com/Ionaru/easy-markdown-editor/pull/358
[#357]: https://github.com/Ionaru/easy-markdown-editor/pull/357
[#322]: https://github.com/Ionaru/easy-markdown-editor/pull/322
[#316]: https://github.com/Ionaru/easy-markdown-editor/pull/316
[#313]: https://github.com/Ionaru/easy-markdown-editor/pull/313
[#311]: https://github.com/Ionaru/easy-markdown-editor/pull/311
[#308]: https://github.com/Ionaru/easy-markdown-editor/pull/308
[#298]: https://github.com/Ionaru/easy-markdown-editor/pull/298
[#293]: https://github.com/Ionaru/easy-markdown-editor/pull/293
[#286]: https://github.com/Ionaru/easy-markdown-editor/pull/286
[#285]: https://github.com/Ionaru/easy-markdown-editor/pull/285
[#284]: https://github.com/Ionaru/easy-markdown-editor/pull/284
[#280]: https://github.com/Ionaru/easy-markdown-editor/pull/280
[#277]: https://github.com/Ionaru/easy-markdown-editor/pull/277
[#272]: https://github.com/Ionaru/easy-markdown-editor/pull/272
[#267]: https://github.com/Ionaru/easy-markdown-editor/pull/267
[#253]: https://github.com/Ionaru/easy-markdown-editor/pull/253
[#250]: https://github.com/Ionaru/easy-markdown-editor/pull/250
[#249]: https://github.com/Ionaru/easy-markdown-editor/pull/249
[#244]: https://github.com/Ionaru/easy-markdown-editor/pull/244
[#235]: https://github.com/Ionaru/easy-markdown-editor/pull/235
[#225]: https://github.com/Ionaru/easy-markdown-editor/pull/225
[#224]: https://github.com/Ionaru/easy-markdown-editor/pull/224
[#223]: https://github.com/Ionaru/easy-markdown-editor/pull/223
[#222]: https://github.com/Ionaru/easy-markdown-editor/pull/222
[#196]: https://github.com/Ionaru/easy-markdown-editor/pull/196
[#184]: https://github.com/Ionaru/easy-markdown-editor/pull/184
[#181]: https://github.com/Ionaru/easy-markdown-editor/pull/181
[#175]: https://github.com/Ionaru/easy-markdown-editor/pull/175
[#173]: https://github.com/Ionaru/easy-markdown-editor/pull/173
[#170]: https://github.com/Ionaru/easy-markdown-editor/pull/170
[#169]: https://github.com/Ionaru/easy-markdown-editor/pull/169
[#150]: https://github.com/Ionaru/easy-markdown-editor/pull/150
[#147]: https://github.com/Ionaru/easy-markdown-editor/pull/147
[#143]: https://github.com/Ionaru/easy-markdown-editor/pull/143
[#141]: https://github.com/Ionaru/easy-markdown-editor/pull/141
[#139]: https://github.com/Ionaru/easy-markdown-editor/pull/139
[#132]: https://github.com/Ionaru/easy-markdown-editor/pull/132
[#123]: https://github.com/Ionaru/easy-markdown-editor/pull/123
[#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109
[#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106
[#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101
[#97]: https://github.com/Ionaru/easy-markdown-editor/pull/97
[#95]: https://github.com/Ionaru/easy-markdown-editor/pull/95
[#93]: https://github.com/Ionaru/easy-markdown-editor/pull/93
[#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75
[#71]: https://github.com/Ionaru/easy-markdown-editor/pull/71
[#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54
[#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31
[#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27
[#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19
<!-- Linked users -->
[@dependabot]: https://github.com/dependabot
[@wwsalmon]: https://github.com/wwsalmon
[@ChronosMasterOfAllTime]: https://github.com/ChronosMasterOfAllTime
[@deerboy]: https://github.com/deerboy
[@marekdedic]: https://github.com/marekdedic
[@emirotin]: https://github.com/emirotin
[@smundro]: https://github.com/smundro
[@Juupaa]: https://github.com/Juupaa
[@Fanvadar]: https://github.com/Fanvadar
[@danice]: https://github.com/danice
[@joahim]: https://github.com/joahim
[@nhymxu]: https://github.com/nhymxu
[@mbolli]: https://github.com/mbolli
[@ivictbor]: https://github.com/ivictbor
[@JoshuaLicense]: https://github.com/JoshuaLicense
[@czynskee]: https://github.com/czynskee
[@nick-denry]: https://github.com/nick-denry
[@StefKors]: https://github.com/StefKors
[@felipefdl]: https://github.com/felipefdl
[@A-312]: https://github.com/A-312
[@dima-bzz]: https://github.com/dima-bzz
[@firm1]: https://github.com/firm1
[@Situphen]: https://github.com/Situphen
[@t49tran]: https://github.com/t49tran
[@richtera]: https://github.com/richtera
[@jfly]: https://github.com/jfly
[@sperezp]: https://github.com/sperezp
[@JeroenvO]: https://github.com/JeroenvO
[@sn3p]: https://github.com/sn3p
[@roryok]: https://github.com/roryok
[@ysykzheng]: https://github.com/ysykzheng
[@roipoussiere]: https://github.com/roipoussiere
[@FranklinWhale]: https://github.com/FranklinWhale
[@Furgas]: https://github.com/Furgas
[@adamb70]: https://github.com/adamb70
[@Summon528]: https://github.com/Summon528
[@LeviticusMB]: https://github.com/LeviticusMB
[@n-3-0]: https://github.com/n-3-0
[@aphitiel]: https://github.com/aphitiel
[@sne11ius]: https://github.com/sne11ius
[@souljuse]: https://github.com/souljuse
[@ukjinjang]: https://github.com/ukjinjang
[@robjean9]: https://github.com/robjean9
[@Offerel]: https://github.com/Offerel
[@Zignature]: https://github.com/Zignature
[@kelvinj]: https://github.com/kelvinj
[@diego-gw]: https://github.com/diego-gw
[@danielok1993]: https://github.com/danielok1993
[@vanillajonathan]: https://github.com/vanillajonathan
[@LevitatingOrange]: https://github.com/LevitatingOrange
[@LoyalPotato]: https://github.com/LoyalPotato
[@kicksent]: https://github.com/kicksent
[@hlf20010508]: https://github.com/hlf20010508
[@ZsgsDesign]: https://github.com/ZsgsDesign
[@sghoweri]: https://github.com/sghoweri
[@borodean]: https://github.com/borodean
[@robinvandernoord]: https://github.com/robinvandernoord
[@p1gp1g]: https://github.com/p1gp1g
[@mayraamaral]: https://github.com/mayraamaral
[@codingjoe]: https://github.com/codingjoe
<!-- Linked versions -->
[Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.20.0...HEAD
[2.20.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.19.0...2.20.0
[2.19.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.18.0...2.19.0
[2.18.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.17.0...2.18.0
[2.17.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.16.1...2.17.0
[2.16.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.16.0...2.16.1
[2.16.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.15.0...2.16.0
[2.15.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.14.0...2.15.0
[2.14.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.13.0...2.14.0
[2.13.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.12.1...2.13.0
[2.12.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.12.0...2.12.1
[2.12.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.11.0...2.12.0
[2.11.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.10.1...2.11.0
[2.10.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.10.0...2.10.1
[2.10.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.9.0...2.10.0
[2.9.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.8.0...2.9.0
[2.8.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.7.0...2.8.0
[2.7.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.1...2.7.0
[2.6.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.0...2.6.1
[2.6.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.1...2.6.0
[2.5.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.0...2.5.1
[2.5.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.4.2...2.5.0
[2.4.2]: https://github.com/Ionaru/easy-markdown-editor/compare/2.4.1...2.4.2
[2.4.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.4.0...2.4.1
[2.4.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.2.2...2.4.0
[2.2.2]: https://github.com/Ionaru/easy-markdown-editor/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.0.1...2.2.1
[2.0.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/Ionaru/easy-markdown-editor/compare/1.11.2...2.0.0

44
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,44 @@
# Contributing
Thank you so much for your interest in contributing to EasyMDE!
## Asking questions, suggesting ideas or reporting bugs
You can [submit an issue](https://github.com/Ionaru/easy-markdown-editor/issues) on this GitHub repository.
## Coding
### 📦 Prerequisites
To contribute code to this project you'll need an up-to-date LTS or current version of Node.js and npm.
Please find information about the installation on [the official Node.js website](https://nodejs.org/en/download/).
### ⤴️ Workflow
Please make sure any code you submit is compliant and compatible with this repository's [license](./LICENSE).
#### Your first pull request
1. [Create a fork of this project](https://github.com/Ionaru/easy-markdown-editor/fork).
1. Clone your fork: `git clone https://github.com/YOUR_USERNAME/easy-markdown-editor.git`.
1. Add the original repository as remote to keep it up-to-date: `git remote add upstream https://github.com/Ionaru/easy-markdown-editor.git`.
1. Fetch the latest changes from upstream: `git fetch upstream`.
1. Run `npm ci` to install the required dependencies.
1. Create a new branch to work on: `git checkout -b MyNewFeatureName`.
1. Write your awesome improvement and commit your work.
1. Make sure your changes comply with the established code and tests succeed: `npm run test`.
1. Push your changes to GitHub: `git push origin`.
1. On GitHub, go to your forked branch, and click **New pull request**.
1. Choose the correct branches, add a description and submit your pull request!
#### Continuing development
To create more pull requests, please follow the steps below:
1. Go back to the master branch: `git checkout master`.
1. Fetch the upstream changes: `git fetch upstream`.
1. Update the master branch with upstream changes: `git merge upstream/master`.
1. Repeat ["Your first pull request"](#your-first-pull-request) from step 5.
Thank you! 💜

View File

@ -1,6 +1,7 @@
The MIT License (MIT)
Copyright (c) 2015 Next Step Webs, Inc.
Copyright (c) 2015 Sparksuite, Inc.
Copyright (c) 2017 Jeroen Akkerman.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -19,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

588
README.md
View File

@ -1,73 +1,571 @@
# Markdownify - Markdown Editor
A drop-in JavaScript textarea replacement for writing beautiful and understandable markdown. The WYSIWYG-esque editor allows you to modify the markdown with toolbar buttons and shortcuts. It has been designed to be easy to use by users who are less technical.
# EasyMDE - Markdown Editor
![Preview](http://i.imgur.com/l5antiW.png)
[![npm version](https://img.shields.io/npm/v/easymde.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde)
[![npm @next version](https://img.shields.io/npm/v/easymde/next.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/next)
[![npm @v3-alpha version](https://img.shields.io/npm/v/easymde/v3-alpha.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/v3-alpha)
[![Build Status](https://img.shields.io/github/actions/workflow/status/ionaru/easy-markdown-editor/cd.yaml?branch=master&style=for-the-badge)](https://github.com/Ionaru/easy-markdown-editor/actions?query=branch%3Amaster)
## Quickstart
> This repository is a fork of
[SimpleMDE, made by Sparksuite](https://github.com/sparksuite/simplemde-markdown-editor/).
Go to the [dedicated section](#simplemde-fork) for more information.
A drop-in JavaScript text area replacement for writing beautiful and understandable Markdown.
EasyMDE allows users who may be less experienced with Markdown to use familiar toolbar buttons and shortcuts.
In addition, the syntax is rendered while editing to clearly show the expected result. Headings are larger, emphasized words are italicized, links are underlined, etc.
EasyMDE also features both built-in auto saving and spell checking.
The editor is entirely customizable, from theming to toolbar buttons and javascript hooks.
[**Try the demo**](https://stackblitz.com/edit/easymde/)
[![Preview](https://user-images.githubusercontent.com/3472373/51319377-26fe6e00-1a5d-11e9-8cc6-3137a566796d.png)](https://stackblitz.com/edit/easymde/)
## Quick access
- [EasyMDE - Markdown Editor](#easymde---markdown-editor)
- [Quick access](#quick-access)
- [Install EasyMDE](#install-easymde)
- [How to use](#how-to-use)
- [Loading the editor](#loading-the-editor)
- [Editor functions](#editor-functions)
- [Configuration](#configuration)
- [Options list](#options-list)
- [Options example](#options-example)
- [Toolbar icons](#toolbar-icons)
- [Toolbar customization](#toolbar-customization)
- [Keyboard shortcuts](#keyboard-shortcuts)
- [Advanced use](#advanced-use)
- [Event handling](#event-handling)
- [Removing EasyMDE from text area](#removing-easymde-from-text-area)
- [Useful methods](#useful-methods)
- [How it works](#how-it-works)
- [SimpleMDE fork](#simplemde-fork)
- [Hacking EasyMDE](#hacking-easymde)
- [Contributing](#contributing)
- [License](#license)
## Install EasyMDE
Via [npm](https://www.npmjs.com/package/easymde):
```
<link rel="stylesheet" href="/PATH/TO/markdownify.min.css">
<script src="/PATH/TO/markdownify.min.js"></script>
npm install easymde
```
And then load Markdownify on the first textarea on a page
Via the *UNPKG* CDN:
```
var markdownify = new Markdownify();
markdownify.render();
```html
<link rel="stylesheet" href="https://unpkg.com/easymde/dist/easymde.min.css">
<script src="https://unpkg.com/easymde/dist/easymde.min.js"></script>
```
#### Use a specific textarea
Pure JavaScript method
```
var markdownify = new Markdownify(document.getElementById("MyID"));
markdownify.render();
Or *jsDelivr*:
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
```
jQuery method
## How to use
```
var markdownify = new Markdownify($("#MyID")[0]);
markdownify.render();
### Loading the editor
After installing and/or importing the module, you can load EasyMDE onto the first `textarea` element on the web page:
```html
<textarea></textarea>
<script>
const easyMDE = new EasyMDE();
</script>
```
## Get the content
Alternatively you can select a specific `textarea`, via JavaScript:
```html
<textarea id="my-text-area"></textarea>
<script>
const easyMDE = new EasyMDE({element: document.getElementById('my-text-area')});
</script>
```
markdownify.codemirror.getValue();
### Editor functions
Use `easyMDE.value()` to get the content of the editor:
```html
<script>
easyMDE.value();
</script>
```
Use `easyMDE.value(val)` to set the content of the editor:
```html
<script>
easyMDE.value('New input for **EasyMDE**');
</script>
```
## Configuration
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
- **status**: If set false, hide the statusbar. Defaults to true.
- **tools**: If set false, hide the toolbar. Defaults to true.
### Options list
```
new Markdownify({
element: document.getElementById("MyID"),
status: false,
tools: false,
- **autoDownloadFontAwesome**: If set to `true`, force downloads Font Awesome (used for icons). If set to `false`, prevents downloading. Defaults to `undefined`, which will intelligently check whether Font Awesome has already been included, then download accordingly.
- **autofocus**: If set to `true`, focuses the editor automatically. Defaults to `false`.
- **autosave**: *Saves the text that's being written and will load it back in the future. It will forget the text when the form it's contained in is submitted.*
- **enabled**: If set to `true`, saves the text automatically. Defaults to `false`.
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10 seconds).
- **submit_delay**: Delay before assuming that submit of the form failed and saving the text, in milliseconds. Defaults to `autosave.delay` or `10000` (10 seconds).
- **uniqueId**: You must set a unique string identifier so that EasyMDE can autosave. Something that separates this from other instances of EasyMDE elsewhere on your website.
- **timeFormat**: Set DateTimeFormat. More information see [DateTimeFormat instances](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat). Default `locale: en-US, format: hour:minute`.
- **text**: Set text for autosave.
- **autoRefresh**: Useful, when initializing the editor in a hidden DOM node. If set to `{ delay: 300 }`, it will check every 300 ms if the editor is visible and if positive, call CodeMirror's [`refresh()`](https://codemirror.net/doc/manual.html#refresh).
- **blockStyles**: Customize how certain buttons that style blocks of text behave.
- **bold**: Can be set to `**` or `__`. Defaults to `**`.
- **code**: Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
- **italic**: Can be set to `*` or `_`. Defaults to `*`.
- **unorderedListStyle**: can be `*`, `-` or `+`. Defaults to `*`.
- **scrollbarStyle**: Chooses a scrollbar implementation. The default is "native", showing native scrollbars. The core library also provides the "null" style, which completely hides the scrollbars. Addons can implement additional scrollbar models.
- **element**: The DOM element for the `textarea` element to use. Defaults to the first `textarea` element on the page.
- **forceSync**: If set to `true`, force text changes made in EasyMDE to be immediately stored in original text area. Defaults to `false`.
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
- **initialValue**: If set, will customize the initial value of the editor.
- **previewImagesInEditor**: - EasyMDE will show preview of images, `false` by default, preview for images will appear only for images on separate lines.
- **imagesPreviewHandler**: - A custom function for handling the preview of images. Takes the parsed string between the parantheses of the image markdown `![]( )` as argument and returns a string that serves as the `src` attribute of the `<img>` tag in the preview. Enables dynamic previewing of images in the frontend without having to upload them to a server, allows copy-pasting of images to the editor with preview.
- **insertTexts**: Customize how certain buttons that insert text behave. Takes an array with two elements. The first element will be the text inserted before the cursor or highlight, and the second element will be inserted after. For example, this is the default link value: `["[", "](http://)"]`.
- horizontalRule
- image
- link
- table
- **lineNumbers**: If set to `true`, enables line numbers in the editor.
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
- **minHeight**: Sets the minimum height for the composition area, before it starts auto-growing. Should be a string containing a valid CSS value like `"500px"`. Defaults to `"300px"`.
- **maxHeight**: Sets fixed height for the composition area. `minHeight` option will be ignored. Should be a string containing a valid CSS value like `"500px"`. Defaults to `undefined`.
- **onToggleFullScreen**: A function that gets called when the editor's full screen mode is toggled. The function will be passed a boolean as parameter, `true` when the editor is currently going into full screen mode, or `false`.
- **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing).
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
- **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`.
- **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`.
- **overlayMode**: Pass a custom codemirror [overlay mode](https://codemirror.net/doc/manual.html#modeapi) to parse and style the Markdown during editing.
- **mode**: A codemirror mode object.
- **combine**: If set to `false`, will *replace* CSS classes returned by the default Markdown mode. Otherwise the classes returned by the custom mode will be combined with the classes returned by the default mode. Defaults to `true`.
- **placeholder**: If set, displays a custom placeholder message.
- **previewClass**: A string or array of strings that will be applied to the preview screen when activated. Defaults to `"editor-preview"`.
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
- **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`.
- **promptTexts**: Customize the text used to prompt for URLs.
- **image**: The text to use when prompting for an image's URL. Defaults to `URL of the image:`.
- **link**: The text to use when prompting for a link's URL. Defaults to `URL for the link:`.
- **iconClassMap**: Used to specify the icon class names for the various toolbar buttons.
- **uploadImage**: If set to `true`, enables the image upload functionality, which can be triggered by drag and drop, copy-paste and through the browse-file window (opened when the user click on the *upload-image* icon). Defaults to `false`.
- **imageMaxSize**: Maximum image size in bytes, checked before upload (note: never trust client, always check the image size at server-side). Defaults to `1024 * 1024 * 2` (2 MB).
- **imageAccept**: A comma-separated list of mime-types used to check image type before upload (note: never trust client, always check file types at server-side). Defaults to `image/png, image/jpeg`.
- **imageUploadFunction**: A custom function for handling the image upload. Using this function will render the options `imageMaxSize`, `imageAccept`, `imageUploadEndpoint` and `imageCSRFToken` ineffective.
- The function gets a file and `onSuccess` and `onError` callback functions as parameters. `onSuccess(imageUrl: string)` and `onError(errorMessage: string)`
- **imageUploadEndpoint**: The endpoint where the images data will be sent, via an asynchronous *POST* request. The server is supposed to save this image, and return a JSON response.
- if the request was successfully processed (HTTP 200 OK): `{"data": {"filePath": "<filePath>"}}` where *filePath* is the path of the image (absolute if `imagePathAbsolute` is set to true, relative if otherwise);
- otherwise: `{"error": "<errorCode>"}`, where *errorCode* can be `noFileGiven` (HTTP 400 Bad Request), `typeNotAllowed` (HTTP 415 Unsupported Media Type), `fileTooLarge` (HTTP 413 Payload Too Large) or `importError` (see *errorMessages* below). If *errorCode* is not one of the *errorMessages*, it is alerted unchanged to the user. This allows for server-side error messages.
No default value.
- **imagePathAbsolute**: If set to `true`, will treat `imageUrl` from `imageUploadFunction` and *filePath* returned from `imageUploadEndpoint` as an absolute rather than relative path, i.e. not prepend `window.location.origin` to it.
- **imageCSRFToken**: CSRF token to include with AJAX call to upload image. For various instances like Django, Spring and Laravel.
- **imageCSRFName**: CSRF token filed name to include with AJAX call to upload image, applied when `imageCSRFToken` has value, defaults to `csrfmiddlewaretoken`.
- **imageCSRFHeader**: If set to `true`, passing CSRF token via header. Defaults to `false`, which pass CSRF through request body.
- **imageTexts**: Texts displayed to the user (mainly on the status bar) for the import image feature, where `#image_name#`, `#image_size#` and `#image_max_size#` will replaced by their respective values, that can be used for customization or internationalization:
- **sbInit**: Status message displayed initially if `uploadImage` is set to `true`. Defaults to `Attach files by drag and dropping or pasting from clipboard.`.
- **sbOnDragEnter**: Status message displayed when the user drags a file to the text area. Defaults to `Drop image to upload it.`.
- **sbOnDrop**: Status message displayed when the user drops a file in the text area. Defaults to `Uploading images #images_names#`.
- **sbProgress**: Status message displayed to show uploading progress. Defaults to `Uploading #file_name#: #progress#%`.
- **sbOnUploaded**: Status message displayed when the image has been uploaded. Defaults to `Uploaded #image_name#`.
- **sizeUnits**: A comma-separated list of units used to display messages with human-readable file sizes. Defaults to ` B, KB, MB` (example: `218 KB`). You can use `B,KB,MB` instead if you prefer without whitespaces (`218KB`).
- **errorMessages**: Errors displayed to the user, using the `errorCallback` option, where `#image_name#`, `#image_size#` and `#image_max_size#` will replaced by their respective values, that can be used for customization or internationalization:
- **noFileGiven**: The server did not receive any file from the user. Defaults to `You must select a file.`.
- **typeNotAllowed**: The user send a file type which doesn't match the `imageAccept` list, or the server returned this error code. Defaults to `This image type is not allowed.`.
- **fileTooLarge**: The size of the image being imported is bigger than the `imageMaxSize`, or if the server returned this error code. Defaults to `Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.`.
- **importError**: An unexpected error occurred when uploading the image. Defaults to `Something went wrong when uploading the image #image_name#.`.
- **errorCallback**: A callback function used to define how to display an error message. Defaults to `(errorMessage) => alert(errorMessage)`.
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
- **codeSyntaxHighlighting**: If set to `true`, will highlight using [highlight.js](https://github.com/isagalaev/highlight.js). Defaults to `false`. To use this feature you must include highlight.js on your page or pass in using the `hljs` option. For example, include the script and the CSS files like:<br>`<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>`<br>`<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">`
- **hljs**: An injectible instance of [highlight.js](https://github.com/isagalaev/highlight.js). If you don't want to rely on the global namespace (`window.hljs`), you can provide an instance here. Defaults to `undefined`.
- **markedOptions**: Set the internal Markdown renderer's [options](https://marked.js.org/#/USING_ADVANCED.md#options). Other `renderingConfig` options will take precedence.
- **singleLineBreaks**: If set to `false`, disable parsing [GitHub Flavored Markdown](https://github.github.com/gfm/) (GFM) single line breaks. Defaults to `true`.
- **sanitizerFunction**: Custom function for sanitizing the HTML output of Markdown renderer.
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
- **showIcons**: An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar.
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`. Optionally pass a CodeMirrorSpellChecker-compliant function.
- **inputStyle**: `textarea` or `contenteditable`. Defaults to `textarea` for desktop and `contenteditable` for mobile. `contenteditable` option is necessary to enable nativeSpellcheck.
- **nativeSpellcheck**: If set to `false`, disable native spell checker. Defaults to `true`.
- **sideBySideFullscreen**: If set to `false`, allows side-by-side editing without going into fullscreen. Defaults to `true`.
- **status**: If set to `false`, hide the status bar. Defaults to the array of built-in status bar items.
- Optionally, you can set an array of status bar items to include, and in what order. You can even define your own custom status bar items.
- **styleSelectedText**: If set to `false`, remove the `CodeMirror-selectedtext` class from selected lines. Defaults to `true`.
- **syncSideBySidePreviewScroll**: If set to `false`, disable syncing scroll in side by side mode. Defaults to `true`.
- **tabSize**: If set, customize the tab size. Defaults to `2`.
- **theme**: Override the theme. Defaults to `easymde`.
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
- **toolbarButtonClassPrefix**: Adds a prefix to the toolbar button classes when set. For example, a value of `"mde"` results in `"mde-bold"` for the Bold button.
- **direction**: `rtl` or `ltr`. Changes text direction to support right-to-left languages. Defaults to `ltr`.
### Options example
Most options demonstrate the non-default behavior:
```js
const editor = new EasyMDE({
autofocus: true,
autosave: {
enabled: true,
uniqueId: "MyUniqueID",
delay: 1000,
submit_delay: 5000,
timeFormat: {
locale: 'en-US',
format: {
year: 'numeric',
month: 'long',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
},
},
text: "Autosaved: "
},
blockStyles: {
bold: "__",
italic: "_",
},
unorderedListStyle: "-",
element: document.getElementById("MyID"),
forceSync: true,
hideIcons: ["guide", "heading"],
indentWithTabs: false,
initialValue: "Hello world!",
insertTexts: {
horizontalRule: ["", "\n\n-----\n\n"],
image: ["![](http://", ")"],
link: ["[", "](https://)"],
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],
},
lineWrapping: false,
minHeight: "500px",
parsingConfig: {
allowAtxHeaderWithoutSpace: true,
strikethrough: false,
underscoresBreakWords: true,
},
placeholder: "Type here...",
previewClass: "my-custom-styling",
previewClass: ["my-custom-styling", "more-custom-styling"],
previewRender: (plainText) => customMarkdownParser(plainText), // Returns HTML from a custom parser
previewRender: (plainText, preview) => { // Async method
setTimeout(() => {
preview.innerHTML = customMarkdownParser(plainText);
}, 250);
// If you return null, the innerHTML of the preview will not
// be overwritten. Useful if you control the preview node's content via
// vdom diffing.
// return null;
return "Loading...";
},
promptURLs: true,
promptTexts: {
image: "Custom prompt for URL:",
link: "Custom prompt for URL:",
},
renderingConfig: {
singleLineBreaks: false,
codeSyntaxHighlighting: true,
sanitizerFunction: (renderedHTML) => {
// Using DOMPurify and only allowing <b> tags
return DOMPurify.sanitize(renderedHTML, {ALLOWED_TAGS: ['b']})
},
},
shortcuts: {
drawTable: "Cmd-Alt-T"
},
showIcons: ["code", "table"],
spellChecker: false,
status: false,
status: ["autosave", "lines", "words", "cursor"], // Optional usage
status: ["autosave", "lines", "words", "cursor", {
className: "keystrokes",
defaultValue: (el) => {
el.setAttribute('data-keystrokes', 0);
},
onUpdate: (el) => {
const keystrokes = Number(el.getAttribute('data-keystrokes')) + 1;
el.innerHTML = `${keystrokes} Keystrokes`;
el.setAttribute('data-keystrokes', keystrokes);
},
}], // Another optional usage, with a custom status bar item that counts keystrokes
styleSelectedText: false,
sideBySideFullscreen: false,
syncSideBySidePreviewScroll: false,
tabSize: 4,
toolbar: false,
toolbarTips: false,
toolbarButtonClassPrefix: "mde",
});
```
### Toolbar icons
Below are the built-in toolbar icons (only some of which are enabled by default), which can be reorganized however you like. "Name" is the name of the icon, referenced in the JavaScript. "Action" is either a function or a URL to open. "Class" is the class given to the icon. "Tooltip" is the small tooltip that appears via the `title=""` attribute. Note that shortcut hints are added automatically and reflect the specified action if it has a key bind assigned to it (i.e. with the value of `action` set to `bold` and that of `tooltip` set to `Bold`, the final text the user will see would be "Bold (Ctrl-B)").
Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array.
Name | Action | Tooltip<br>Class
:--- | :----- | :--------------
bold | toggleBold | Bold<br>fa fa-bold
italic | toggleItalic | Italic<br>fa fa-italic
strikethrough | toggleStrikethrough | Strikethrough<br>fa fa-strikethrough
heading | toggleHeadingSmaller | Heading<br>fa fa-header
heading-smaller | toggleHeadingSmaller | Smaller Heading<br>fa fa-header
heading-bigger | toggleHeadingBigger | Bigger Heading<br>fa fa-lg fa-header
heading-1 | toggleHeading1 | Big Heading<br>fa fa-header header-1
heading-2 | toggleHeading2 | Medium Heading<br>fa fa-header header-2
heading-3 | toggleHeading3 | Small Heading<br>fa fa-header header-3
code | toggleCodeBlock | Code<br>fa fa-code
quote | toggleBlockquote | Quote<br>fa fa-quote-left
unordered-list | toggleUnorderedList | Generic List<br>fa fa-list-ul
ordered-list | toggleOrderedList | Numbered List<br>fa fa-list-ol
clean-block | cleanBlock | Clean block<br>fa fa-eraser
link | drawLink | Create Link<br>fa fa-link
image | drawImage | Insert Image<br>fa fa-picture-o
upload-image | drawUploadedImage | Raise browse-file window<br>fa fa-image
table | drawTable | Insert Table<br>fa fa-table
horizontal-rule | drawHorizontalRule | Insert Horizontal Line<br>fa fa-minus
preview | togglePreview | Toggle Preview<br>fa fa-eye no-disable
side-by-side | toggleSideBySide | Toggle Side by Side<br>fa fa-columns no-disable no-mobile
fullscreen | toggleFullScreen | Toggle Fullscreen<br>fa fa-arrows-alt no-disable no-mobile
guide | [This link](https://www.markdownguide.org/basic-syntax/) | Markdown Guide<br>fa fa-question-circle
undo | undo | Undo<br>fa fa-undo
redo | redo | Redo<br>fa fa-redo
### Toolbar customization
Customize the toolbar using the `toolbar` option.
Only the order of existing buttons:
```js
const easyMDE = new EasyMDE({
toolbar: ["bold", "italic", "heading", "|", "quote"]
});
```
All information and/or add your own icons or text
```js
const easyMDE = new EasyMDE({
toolbar: [
{
name: "bold",
action: EasyMDE.toggleBold,
className: "fa fa-bold",
title: "Bold",
},
"italic", // shortcut to pre-made button
{
name: "custom",
action: (editor) => {
// Add your own code
},
className: "fa fa-star",
text: "Starred",
title: "Custom Button",
attributes: { // for custom attributes
id: "custom-id",
"data-value": "custom value" // HTML5 data-* attributes need to be enclosed in quotation marks ("") because of the dash (-) in its name.
}
},
"|" // Separator
// [, ...]
]
});
```
Put some buttons on dropdown menu
```js
const easyMDE = new EasyMDE({
toolbar: [{
name: "heading",
action: EasyMDE.toggleHeadingSmaller,
className: "fa fa-header",
title: "Headers",
},
"|",
{
name: "others",
className: "fa fa-blind",
title: "others buttons",
children: [
{
name: "image",
action: EasyMDE.drawImage,
className: "fa fa-picture-o",
title: "Image",
},
{
name: "quote",
action: EasyMDE.toggleBlockquote,
className: "fa fa-percent",
title: "Quote",
},
{
name: "link",
action: EasyMDE.drawLink,
className: "fa fa-link",
title: "Link",
}
]
},
// [, ...]
]
});
```
### Keyboard shortcuts
EasyMDE comes with an array of predefined keyboard shortcuts, but they can be altered with a configuration option. The list of default ones is as follows:
Shortcut (Windows / Linux) | Shortcut (macOS) | Action
:--- | :--- | :---
<kbd>Ctrl</kbd>-<kbd>'</kbd> | <kbd>Cmd</kbd>-<kbd>'</kbd> | "toggleBlockquote"
<kbd>Ctrl</kbd>-<kbd>B</kbd> | <kbd>Cmd</kbd>-<kbd>B</kbd> | "toggleBold"
<kbd>Ctrl</kbd>-<kbd>E</kbd> | <kbd>Cmd</kbd>-<kbd>E</kbd> | "cleanBlock"
<kbd>Ctrl</kbd>-<kbd>H</kbd> | <kbd>Cmd</kbd>-<kbd>H</kbd> | "toggleHeadingSmaller"
<kbd>Ctrl</kbd>-<kbd>I</kbd> | <kbd>Cmd</kbd>-<kbd>I</kbd> | "toggleItalic"
<kbd>Ctrl</kbd>-<kbd>K</kbd> | <kbd>Cmd</kbd>-<kbd>K</kbd> | "drawLink"
<kbd>Ctrl</kbd>-<kbd>L</kbd> | <kbd>Cmd</kbd>-<kbd>L</kbd> | "toggleUnorderedList"
<kbd>Ctrl</kbd>-<kbd>P</kbd> | <kbd>Cmd</kbd>-<kbd>P</kbd> | "togglePreview"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>C</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>C</kbd> | "toggleCodeBlock"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>I</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>I</kbd> | "drawImage"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>L</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>L</kbd> | "toggleOrderedList"
<kbd>Shift</kbd>-<kbd>Ctrl</kbd>-<kbd>H</kbd> | <kbd>Shift</kbd>-<kbd>Cmd</kbd>-<kbd>H</kbd> | "toggleHeadingBigger"
<kbd>F9</kbd> | <kbd>F9</kbd> | "toggleSideBySide"
<kbd>F11</kbd> | <kbd>F11</kbd> | "toggleFullScreen"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>1</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>1</kbd> | "toggleHeading1"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>2</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>2</kbd> | "toggleHeading2"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>3</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>3</kbd> | "toggleHeading3"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>4</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>4</kbd> | "toggleHeading4"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>5</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>5</kbd> | "toggleHeading5"
<kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>6</kbd> | <kbd>Cmd</kbd>-<kbd>Alt</kbd>-<kbd>6</kbd> | "toggleHeading6"
Here is how you can change a few, while leaving others untouched:
```js
const editor = new EasyMDE({
shortcuts: {
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
"toggleCodeBlock": null, // unbind Ctrl-Alt-C
"drawTable": "Cmd-Alt-T", // bind Cmd-Alt-T to drawTable action, which doesn't come with a default shortcut
}
});
```
Shortcuts are automatically converted between platforms. If you define a shortcut as "Cmd-B", on PC that shortcut will be changed to "Ctrl-B". Conversely, a shortcut defined as "Ctrl-B" will become "Cmd-B" for Mac users.
The list of actions that can be bound is the same as the list of built-in actions available for [toolbar buttons](#toolbar-icons).
## Advanced use
### Event handling
You can catch the following list of events: https://codemirror.net/doc/manual.html#events
```js
const easyMDE = new EasyMDE();
easyMDE.codemirror.on("change", () => {
console.log(easyMDE.value());
});
```
### Removing EasyMDE from text area
You can revert to the initial text area by calling the `toTextArea` method. Note that this clears up the autosave (if enabled) associated with it. The text area will retain any text from the destroyed EasyMDE instance.
```js
const easyMDE = new EasyMDE();
// ...
easyMDE.toTextArea();
easyMDE = null;
```
If you need to remove registered event listeners (when the editor is not needed anymore), call `easyMDE.cleanup()`.
### Useful methods
The following self-explanatory methods may be of use while developing with EasyMDE.
```js
const easyMDE = new EasyMDE();
easyMDE.isPreviewActive(); // returns boolean
easyMDE.isSideBySideActive(); // returns boolean
easyMDE.isFullscreenActive(); // returns boolean
easyMDE.clearAutosavedValue(); // no returned value
```
## How it works
Markdownify is an improvement of [lepture's Editor project](https://github.com/lepture/editor) and includes a great many number of changes. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and [Font Awesome](http://fortawesome.github.io/Font-Awesome/).
CodeMirror is the backbone of the project and parses much of the markdown syntax as it's being written. This allows us to add styles to the markdown that's being written. Additionally, a toolbar and statusbar has been added to the top and bottom, respectively. Previews are rendered by [Marked](https://github.com/chjj/marked).
EasyMDE is a continuation of SimpleMDE.
## What's changed?
As mentioned earlier, Markdownify is an improvement of [lepture's Editor project](https://github.com/lepture/editor). So you might be wondering, what's changed? Quite a bit actually. Here's some notable changes:
SimpleMDE began as an improvement of [lepture's Editor project](https://github.com/lepture/editor), but has now taken on an identity of its own. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fontawesome.io).
- Upgraded from CodeMirror 3 to CodeMirror 5
- Many changes to the style, appearance, and userfriendliness
- Interface more closely resembles Bootstrap
- Now mobile friendly
- The text editor now automatically grows as you type more
- Fixed a large amount of bugs
- Switched to Font Awesome icons
- Improved preview rendering in many ways
- Improved as-you-type appearance of headers and code blocks
- Simplified the toolbar
CodeMirror is the backbone of the project and parses much of the Markdown syntax as it's being written. This allows us to add styles to the Markdown that's being written. Additionally, a toolbar and status bar have been added to the top and bottom, respectively. Previews are rendered by [Marked](https://github.com/chjj/marked) using GitHub Flavored Markdown (GFM).
## SimpleMDE fork
I originally made this fork to implement FontAwesome 5 compatibility into SimpleMDE. When that was done I submitted a [pull request](https://github.com/sparksuite/simplemde-markdown-editor/pull/666), which has not been accepted yet. This, and the project being inactive since May 2017, triggered me to make more changes and try to put new life into the project.
Changes include:
* FontAwesome 5 compatibility
* Guide button works when editor is in preview mode
* Links are now `https://` by default
* Small styling changes
* Support for Node 8 and beyond
* Lots of refactored code
* Links in preview will open in a new tab by default
* TypeScript support
My intention is to continue development on this project, improving it and keeping it alive.
## Hacking EasyMDE
You may want to edit this library to adapt its behavior to your needs. This can be done in some quick steps:
1. Follow the [prerequisites](./CONTRIBUTING.md#prerequisites) and [installation](./CONTRIBUTING.md#installation) instructions in the contribution guide;
2. Do your changes;
3. Run `gulp` command, which will generate files: `dist/easymde.min.css` and `dist/easymde.min.js`;
4. Copy-paste those files to your code base, and you are done.
## Contributing
Want to contribute to EasyMDE? Thank you! We have a [contribution guide](./CONTRIBUTING.md) just for you!
## License
This project is released under the [MIT License](./LICENSE).
- Copyright (c) 2015 Sparksuite, Inc.
- Copyright (c) 2017 Jeroen Akkerman.

10
cypress.config.ts Normal file
View File

@ -0,0 +1,10 @@
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
excludeSpecPattern: [
'**/*.html',
],
video: true,
},
});

14
cypress/.eslintrc Normal file
View File

@ -0,0 +1,14 @@
{
"plugins": [
"cypress"
],
"env": {
"node": true,
"es6": true,
"cypress/globals": true
},
"extends": [
"../.eslintrc",
"plugin:cypress/recommended"
]
}

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE();
</script>
</body>
</html>

View File

@ -0,0 +1,31 @@
/// <reference types="cypress" />
describe('Preview', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('can show a preview of markdown text', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('.EasyMDEContainer .editor-preview').should('not.be.visible');
// Enter markdown text.
cy.get('.EasyMDEContainer .CodeMirror').type('# My Big Title');
cy.get('.EasyMDEContainer .CodeMirror').type('{enter}');
cy.get('.EasyMDEContainer .CodeMirror').type('This is some **important** text!');
cy.get('.EasyMDEContainer .CodeMirror-line').should('contain', '# My Big Title');
cy.get('.EasyMDEContainer .cm-header.cm-header-1').should('contain', '#');
cy.get('.EasyMDEContainer .cm-header.cm-header-1').should('contain', 'My Big Title');
cy.get('.EasyMDEContainer .CodeMirror-line').should('contain', 'This is some **important** text!');
cy.get('.EasyMDEContainer .cm-strong').should('contain', '**');
cy.get('.EasyMDEContainer .cm-strong').should('contain', 'important');
cy.previewOn();
// Check preview window for rendered markdown.
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<h1 id="my-big-title">My Big Title</h1>');
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p>This is some <strong>important</strong> text!</p>');
});
});

View File

@ -0,0 +1,56 @@
/// <reference types="cypress" />
describe('Default statusbar', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('loads the editor with default statusbar', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('.EasyMDEContainer .editor-statusbar').should('be.visible');
cy.get('.EasyMDEContainer .editor-statusbar .autosave').should('be.empty');
cy.get('.EasyMDEContainer .editor-statusbar .lines').before('content').should('contain', 'lines: ');
cy.get('.EasyMDEContainer .editor-statusbar .lines').should('contain', '1');
cy.get('.EasyMDEContainer .editor-statusbar .words').before('content').should('contain', 'words: ');
cy.get('.EasyMDEContainer .editor-statusbar .words').should('contain', '0');
cy.get('.EasyMDEContainer .editor-statusbar .cursor').should('contain', '1:1');
});
it('updates the statusbar when typing', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('.EasyMDEContainer .editor-statusbar').should('be.visible');
cy.get('.EasyMDEContainer .CodeMirror').type('Hello');
cy.get('.EasyMDEContainer .editor-statusbar .autosave').should('be.empty');
cy.get('.EasyMDEContainer .editor-statusbar .lines').should('contain', '1');
cy.get('.EasyMDEContainer .editor-statusbar .words').should('contain', '1');
cy.get('.EasyMDEContainer .editor-statusbar .cursor').should('contain', '1:6');
cy.get('.EasyMDEContainer .CodeMirror').type(' World');
cy.get('.EasyMDEContainer .editor-statusbar .lines').should('contain', '1');
cy.get('.EasyMDEContainer .editor-statusbar .words').should('contain', '2');
cy.get('.EasyMDEContainer .editor-statusbar .cursor').should('contain', '1:12');
cy.get('.EasyMDEContainer .CodeMirror').type('{enter}');
cy.get('.EasyMDEContainer .editor-statusbar .lines').should('contain', '2');
cy.get('.EasyMDEContainer .editor-statusbar .words').should('contain', '2');
cy.get('.EasyMDEContainer .editor-statusbar .cursor').should('contain', '2:1');
cy.get('.EasyMDEContainer .CodeMirror').type('This is a sample text.{enter}We\'re testing the statusbar.{enter}Did it work?');
cy.get('.EasyMDEContainer .editor-statusbar .autosave').should('be.empty');
cy.get('.EasyMDEContainer .editor-statusbar .lines').before('content').should('contain', 'lines: ');
cy.get('.EasyMDEContainer .editor-statusbar .lines').should('contain', '4');
cy.get('.EasyMDEContainer .editor-statusbar .words').before('content').should('contain', 'words: ');
cy.get('.EasyMDEContainer .editor-statusbar .words').should('contain', '15');
cy.get('.EasyMDEContainer .editor-statusbar .cursor').should('contain', '4:13');
});
});

View File

@ -0,0 +1,17 @@
/// <reference types="cypress" />
describe('Default editor', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('loads the editor with default settings', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.get('.EasyMDEContainer .editor-toolbar').should('be.visible');
cy.get('.EasyMDEContainer .CodeMirror').should('be.visible');
cy.get('.EasyMDEContainer .editor-preview').should('not.be.visible');
cy.get('.EasyMDEContainer .editor-statusbar').should('be.visible');
});
});

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
promptURLs: true,
});
</script>
</body>
</html>

View File

@ -0,0 +1,232 @@
/// <reference types="cypress" />
describe('URL prompts', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('must show the correct text for a link prompt', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
cy.get('button.link').click();
cy.get('button.link').then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
});
});
});
it('must show the correct text for an image prompt', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
cy.get('button.image').click();
cy.get('button.image').then(() => {
expect(stub).to.be.calledWith('URL of the image:', 'https://');
});
});
});
it('must enter a link correctly through a prompt', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com" target="_blank">Link to a website!</a></p>');
});
it('can use the prompt multiple times', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
stub.returns('https://example.com');
cy.get('button.link').click();
cy.get('button.link').then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
stub.restore();
});
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!{end}{enter}');
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
stub.returns('https://example.eu');
cy.get('button.link').click();
cy.get('button.link').then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
stub.restore();
});
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.eu)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a second website!');
cy.get('.EasyMDEContainer .CodeMirror').contains('[Link to a website!](https://example.com)');
cy.get('.EasyMDEContainer .CodeMirror').contains('[Link to a second website!](https://example.eu)');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should(
'contain.html',
'<p><a href="https://example.com" target="_blank">Link to a website!</a><br><a href="https://example.eu" target="_blank">Link to a second website!</a></p>',
);
});
it('must be able to deal with parameters in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=param&moo=cow');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=param&moo=cow)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=param&amp;moo=cow" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with brackets in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=[]param');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%5B%5Dparam)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%5B%5Dparam" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with parentheses in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=(param)');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param\\))');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param)" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with parentheses in links (multiple)', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=(param1,param2)&more=(param3,param4)&end=true');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param1,param2\\)&more=\\(param3,param4\\)&end=true)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param1,param2)&amp;more=(param3,param4)&amp;end=true" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with unbalanced parentheses in links (opening)', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=(param');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\(param)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=(param" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with unbalanced parentheses in links (closing)', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=)param');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=\\)param)');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=)param" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with inequality symbols in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=<param');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%3Cparam');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%3Cparam" target="_blank">Link to a website!</a></p>');
});
it('must be able to deal with emoji in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=👷‍♂️');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=%F0%9F%91%B7%E2%80%8D%E2%99%82%EF%B8%8F');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a 👌 website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=%F0%9F%91%B7%E2%80%8D%E2%99%82%EF%B8%8F" target="_blank">Link to a 👌 website!</a></p>');
});
it('must be able to deal with spaces in links', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.window().then(($win) => {
cy.stub($win, 'prompt').returns('https://example.com?some=very special param');
cy.get('button.link').click();
});
cy.get('.EasyMDEContainer .CodeMirror').contains('[](https://example.com?some=very%20special%20param');
cy.get('.EasyMDEContainer .CodeMirror').type('{home}{rightarrow}Link to a website!');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<p><a href="https://example.com?some=very%20special%20param" target="_blank">Link to a website!</a></p>');
});
});

View File

@ -0,0 +1,17 @@
/// <reference types="cypress" />
describe('Default editor', () => {
it('table', () => {
cy.visit(__dirname + '/index-no-prefix.html');
cy.get('button.table').should('be.visible');
cy.get('button.table').invoke('outerWidth').should('not.equal', 30);
});
it('loads the editor with default settings', () => {
cy.visit(__dirname + '/index.html');
cy.get('button.mde-table').should('be.visible');
cy.get('button.mde-table').invoke('outerWidth').should('equal', 30);
});
});

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
showIcons: ["table"],
});
</script>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
toolbarButtonClassPrefix: 'mde',
showIcons: ["table"],
});
</script>
</body>
</html>

View File

@ -0,0 +1,43 @@
/// <reference types="cypress" />
describe('Image rendering', () => {
const imageUrl = 'https://picsum.photos/id/237/150';
beforeEach(() => {
cy.visit(__dirname + '/index.html');
cy.intercept('GET', imageUrl).as('image');
});
it('must render an image inside the editor', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.get('.EasyMDEContainer .CodeMirror').type(imageUrl);
cy.get('.EasyMDEContainer .CodeMirror').type('{home}![Dog!]({end})');
cy.wait('@image');
cy.get(`.EasyMDEContainer [data-img-src="${imageUrl}"]`).should('be.visible');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', `<p><img src="${imageUrl}" alt="Dog!"></p>`);
});
it('must be able to handle parentheses inside image alt text', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.get('.EasyMDEContainer .CodeMirror').type(imageUrl);
cy.get('.EasyMDEContainer .CodeMirror').type('{home}![Dog! (He\'s a good boy!)]({end})');
cy.wait('@image');
cy.get(`.EasyMDEContainer [data-img-src="${imageUrl}"]`).should('be.visible');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', `<p><img src="${imageUrl}" alt="Dog! (He's a good boy!)"></p>`);
});
});

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
previewImagesInEditor: true,
});
</script>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
renderingConfig: {
markedOptions: {
headerPrefix: 'header-prefix-',
}
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,18 @@
/// <reference types="cypress" />
describe('Marked options', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('must apply the markedOptions to the markdown parser', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.get('.EasyMDEContainer .CodeMirror').type('# Title{enter}');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<h1 id="header-prefix-title">Title</h1>');
});
});

10
cypress/plugins/index.js Normal file
View File

@ -0,0 +1,10 @@
/// <reference types="cypress" />
/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};

View File

@ -0,0 +1,31 @@
/// <reference types="cypress" />
const unquote = (str) => str.replace(/(^")|("$)/g, '');
Cypress.Commands.add(
'before',
{
prevSubject: 'element',
},
(element, property) => {
const win = element[0].ownerDocument.defaultView;
const before = win.getComputedStyle(element[0], 'before');
return unquote(before.getPropertyValue(property));
},
);
Cypress.Commands.add('previewOn' , () => {
cy.get('.EasyMDEContainer .editor-preview').should('not.be.visible');
cy.get('.EasyMDEContainer .editor-toolbar button.preview').should('not.have.class', 'active');
cy.get('.EasyMDEContainer .editor-toolbar button.preview').click();
cy.get('.EasyMDEContainer .editor-toolbar button.preview').should('have.class', 'active');
cy.get('.EasyMDEContainer .editor-preview').should('be.visible');
});
Cypress.Commands.add('previewOff' , () => {
cy.get('.EasyMDEContainer .editor-preview').should('be.visible');
cy.get('.EasyMDEContainer .editor-toolbar button.preview').should('have.class', 'active');
cy.get('.EasyMDEContainer .editor-toolbar button.preview').click();
cy.get('.EasyMDEContainer .editor-toolbar button.preview').should('not.have.class', 'active');
cy.get('.EasyMDEContainer .editor-preview').should('not.be.visible');
});

1
cypress/support/e2e.js Normal file
View File

@ -0,0 +1 @@
require('./commands');

20
example/index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Example / Preview</title>
<link rel="stylesheet" href="../dist/easymde.min.css">
<script src="../dist/easymde.min.js"></script>
</head>
<body>
<textarea></textarea>
<script>
const easyMDE = new EasyMDE();
</script>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Example / Preview / sideBySideFullscreen : false</title>
<link rel="stylesheet" href="../dist/easymde.min.css">
<script src="../dist/easymde.min.js"></script>
</head>
<body>
<textarea></textarea>
<script>
const easyMDE = new EasyMDE({sideBySideFullscreen: false});
</script>
</body>
</html>

66
gulpfile.js Normal file
View File

@ -0,0 +1,66 @@
'use strict';
var gulp = require('gulp');
var cleanCSS = require('gulp-clean-css');
var terser = require('gulp-terser');
var concat = require('gulp-concat');
var header = require('gulp-header');
var buffer = require('vinyl-buffer');
var pkg = require('./package.json');
var eslint = require('gulp-eslint');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var rename = require('gulp-rename');
var banner = ['/**',
' * <%= pkg.name %> v<%= pkg.version %>',
' * Copyright <%= pkg.author %>',
' * @link https://github.com/ionaru/easy-markdown-editor',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
var css_files = [
'./node_modules/codemirror/lib/codemirror.css',
'./src/css/*.css',
'./node_modules/codemirror-spell-checker/src/css/spell-checker.css',
];
function lint() {
return gulp.src('./src/js/**/*.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
function scripts() {
return browserify({entries: './src/js/easymde.js', standalone: 'EasyMDE'}).bundle()
.pipe(source('easymde.min.js'))
.pipe(buffer())
.pipe(terser())
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest('./dist/'));
}
function styles() {
return gulp.src(css_files)
.pipe(concat('easymde.css'))
.pipe(cleanCSS())
.pipe(rename('easymde.min.css'))
.pipe(buffer())
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest('./dist/'));
}
// Watch for file changes
function watch() {
gulp.watch('./src/js/**/*.js', scripts);
gulp.watch(css_files, styles);
}
var build = gulp.parallel(gulp.series(lint, scripts), styles);
gulp.task('default', build);
gulp.task('watch', gulp.series(build, watch));
gulp.task('lint', lint);

4
markdownify.min.css vendored

File diff suppressed because one or more lines are too long

6
markdownify.min.js vendored

File diff suppressed because one or more lines are too long

17894
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

55
package.json Normal file
View File

@ -0,0 +1,55 @@
{
"name": "easymde",
"version": "2.20.0",
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.",
"files": [
"dist/**/*",
"src/**/*",
"types/easymde.d.ts"
],
"keywords": [
"embeddable",
"markdown",
"editor",
"javascript",
"fontawesome"
],
"main": "src/js/easymde.js",
"types": "types/easymde.d.ts",
"license": "MIT",
"author": "Jeroen Akkerman",
"dependencies": {
"@types/codemirror": "^5.60.10",
"@types/marked": "^4.0.7",
"codemirror": "^5.65.15",
"codemirror-spell-checker": "1.1.2",
"marked": "^4.1.0"
},
"devDependencies": {
"browserify": "^17.0.0",
"cypress": "^13.2.0",
"eslint": "^8.50.0",
"eslint-plugin-cypress": "^2.15.1",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-eslint": "^6.0.0",
"gulp-header": "^2.0.9",
"gulp-rename": "^2.0.0",
"gulp-terser": "^2.1.0",
"gulp-uglify": "^3.0.2",
"typescript": "^5.2.2",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"repository": "github:Ionaru/easy-markdown-editor",
"scripts": {
"prepare": "gulp",
"test": "npm run lint && npm run test:types && npm run e2e",
"lint": "gulp lint",
"cypress:lint": "eslint cypress",
"cypress:run": "cypress run",
"e2e": "gulp && npm run cypress:lint && npm run cypress:run",
"test:types": "tsc --project types/tsconfig.json"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
unorderedListRE = /[*+-]\s/;
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), replacements = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head;
var eolState = cm.getStateAfter(pos.line);
var inList = eolState.list !== false;
var inQuote = eolState.quote !== 0;
var line = cm.getLine(pos.line), match = listRE.exec(line);
if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
cm.execCommand("newlineAndIndent");
return;
}
if (emptyListRE.test(line)) {
cm.replaceRange("", {
line: pos.line, ch: 0
}, {
line: pos.line, ch: pos.ch + 1
});
replacements[i] = "\n";
} else {
var indent = match[1], after = match[5];
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
? match[2]
: (parseInt(match[3], 10) + 1) + match[4];
replacements[i] = "\n" + indent + bullet + after;
}
}
cm.replaceSelections(replacements);
};
});

View File

@ -1,781 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../xml/xml", "../meta"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var htmlFound = CodeMirror.modes.hasOwnProperty("xml");
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain");
function getMode(name) {
if (CodeMirror.findModeByName) {
var found = CodeMirror.findModeByName(name);
if (found) name = found.mime || found.mimes[0];
}
var mode = CodeMirror.getMode(cmCfg, name);
return mode.name == "null" ? null : mode;
}
// Should characters that affect highlighting be highlighted separate?
// Does not include characters that will be output (such as `1.` and `-` for lists)
if (modeCfg.highlightFormatting === undefined)
modeCfg.highlightFormatting = false;
// Maximum number of nested blockquotes. Set to 0 for infinite nesting.
// Excess `>` will emit `error` token.
if (modeCfg.maxBlockquoteDepth === undefined)
modeCfg.maxBlockquoteDepth = 0;
// Should underscores in words open/close em/strong?
if (modeCfg.underscoresBreakWords === undefined)
modeCfg.underscoresBreakWords = true;
// Turn on fenced code blocks? ("```" to start/end)
if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false;
// Turn on task lists? ("- [ ] " and "- [x] ")
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
// Turn on strikethrough syntax
if (modeCfg.strikethrough === undefined)
modeCfg.strikethrough = false;
var codeDepth = 0;
var header = 'header'
, code = 'comment'
, quote = 'quote'
, list1 = 'variable-2'
, list2 = 'variable-3'
, list3 = 'keyword'
, hr = 'hr'
, image = 'tag'
, formatting = 'formatting'
, linkinline = 'link'
, linkemail = 'link'
, linktext = 'link'
, linkhref = 'string'
, em = 'em'
, strong = 'strong'
, strikethrough = 'strikethrough';
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
, ulRE = /^[*\-+]\s+/
, olRE = /^[0-9]+([.)])\s+/
, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE
, atxHeaderRE = /^(#+)(?: |$)/
, setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
, textRE = /^[^#!\[\]*_\\<>` "'(~]+/;
function switchInline(stream, state, f) {
state.f = state.inline = f;
return f(stream, state);
}
function switchBlock(stream, state, f) {
state.f = state.block = f;
return f(stream, state);
}
// Blocks
function blankLine(state) {
// Reset linkTitle state
state.linkTitle = false;
// Reset EM state
state.em = false;
// Reset STRONG state
state.strong = false;
// Reset strikethrough state
state.strikethrough = false;
// Reset state.quote
state.quote = 0;
// Reset state.indentedCode
state.indentedCode = false;
if (!htmlFound && state.f == htmlBlock) {
state.f = inlineNormal;
state.block = blockNormal;
}
// Reset state.trailingSpace
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
// Mark this line as blank
state.thisLineHasContent = false;
return null;
}
function blockNormal(stream, state) {
var sol = stream.sol();
var prevLineIsList = state.list !== false,
prevLineIsIndentedCode = state.indentedCode;
state.indentedCode = false;
if (prevLineIsList) {
if (state.indentationDiff >= 0) { // Continued list
if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
state.indentation -= state.indentationDiff;
}
state.list = null;
} else if (state.indentation > 0) {
state.list = null;
state.listDepth = Math.floor(state.indentation / 4);
} else { // No longer a list
state.list = false;
state.listDepth = 0;
}
}
var match = null;
if (state.indentationDiff >= 4) {
stream.skipToEnd();
if (prevLineIsIndentedCode || !state.prevLineHasContent) {
state.indentation -= 4;
state.indentedCode = true;
return code;
} else {
return null;
}
} else if (stream.eatSpace()) {
return null;
} else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
state.header = match[1].length;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
} else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
state.header = match[0].charAt(0) == '=' ? 1 : 2;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
} else if (stream.eat('>')) {
state.quote = sol ? 1 : state.quote + 1;
if (modeCfg.highlightFormatting) state.formatting = "quote";
stream.eatSpace();
return getType(state);
} else if (stream.peek() === '[') {
return switchInline(stream, state, footnoteLink);
} else if (stream.match(hrRE, true)) {
state.hr = true;
return hr;
} else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
var listType = null;
if (stream.match(ulRE, true)) {
listType = 'ul';
} else {
stream.match(olRE, true);
listType = 'ol';
}
state.indentation += 4;
state.list = true;
state.listDepth++;
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
state.taskList = true;
}
state.f = state.inline;
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
return getType(state);
} else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) {
// try switching mode
state.localMode = getMode(RegExp.$1);
if (state.localMode) state.localState = state.localMode.startState();
state.f = state.block = local;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
return getType(state);
}
return switchInline(stream, state, state.inline);
}
function htmlBlock(stream, state) {
var style = htmlMode.token(stream, state.htmlState);
if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
state.htmlState = null;
}
return style;
}
function local(stream, state) {
if (stream.sol() && stream.match("```", false)) {
state.localMode = state.localState = null;
state.f = state.block = leavingLocal;
return null;
} else if (state.localMode) {
return state.localMode.token(stream, state.localState);
} else {
stream.skipToEnd();
return code;
}
}
function leavingLocal(stream, state) {
stream.match("```");
state.block = blockNormal;
state.f = inlineNormal;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
var returnType = getType(state);
state.code = false;
return returnType;
}
// Inline
function getType(state) {
var styles = [];
if (state.formatting) {
styles.push(formatting);
if (typeof state.formatting === "string") state.formatting = [state.formatting];
for (var i = 0; i < state.formatting.length; i++) {
styles.push(formatting + "-" + state.formatting[i]);
if (state.formatting[i] === "header") {
styles.push(formatting + "-" + state.formatting[i] + "-" + state.header);
}
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
// Add `error` instead if the maximum blockquote nesting depth is passed
if (state.formatting[i] === "quote") {
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote);
} else {
styles.push("error");
}
}
}
}
if (state.taskOpen) {
styles.push("meta");
return styles.length ? styles.join(' ') : null;
}
if (state.taskClosed) {
styles.push("property");
return styles.length ? styles.join(' ') : null;
}
if (state.linkHref) {
styles.push(linkhref, "url");
} else { // Only apply inline styles to non-url text
if (state.strong) { styles.push(strong); }
if (state.em) { styles.push(em); }
if (state.strikethrough) { styles.push(strikethrough); }
if (state.linkText) { styles.push(linktext); }
if (state.code) { styles.push(code); }
}
if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }
if (state.quote) {
styles.push(quote);
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
styles.push(quote + "-" + state.quote);
} else {
styles.push(quote + "-" + modeCfg.maxBlockquoteDepth);
}
}
if (state.list !== false) {
var listMod = (state.listDepth - 1) % 3;
if (!listMod) {
styles.push(list1);
} else if (listMod === 1) {
styles.push(list2);
} else {
styles.push(list3);
}
}
if (state.trailingSpaceNewLine) {
styles.push("trailing-space-new-line");
} else if (state.trailingSpace) {
styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
}
return styles.length ? styles.join(' ') : null;
}
function handleText(stream, state) {
if (stream.match(textRE, true)) {
return getType(state);
}
return undefined;
}
function inlineNormal(stream, state) {
var style = state.text(stream, state);
if (typeof style !== 'undefined')
return style;
if (state.list) { // List marker (*, +, -, 1., etc)
state.list = null;
return getType(state);
}
if (state.taskList) {
var taskOpen = stream.match(taskListRE, true)[1] !== "x";
if (taskOpen) state.taskOpen = true;
else state.taskClosed = true;
if (modeCfg.highlightFormatting) state.formatting = "task";
state.taskList = false;
return getType(state);
}
state.taskOpen = false;
state.taskClosed = false;
if (state.header && stream.match(/^#+$/, true)) {
if (modeCfg.highlightFormatting) state.formatting = "header";
return getType(state);
}
// Get sol() value now, before character is consumed
var sol = stream.sol();
var ch = stream.next();
if (ch === '\\') {
stream.next();
if (modeCfg.highlightFormatting) {
var type = getType(state);
return type ? type + " formatting-escape" : "formatting-escape";
}
}
// Matches link titles present on next line
if (state.linkTitle) {
state.linkTitle = false;
var matchCh = ch;
if (ch === '(') {
matchCh = ')';
}
matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
if (stream.match(new RegExp(regex), true)) {
return linkhref;
}
}
// If this block is changed, it may need to be updated in GFM mode
if (ch === '`') {
var previousFormatting = state.formatting;
if (modeCfg.highlightFormatting) state.formatting = "code";
var t = getType(state);
var before = stream.pos;
stream.eatWhile('`');
var difference = 1 + stream.pos - before;
if (!state.code) {
codeDepth = difference;
state.code = true;
return getType(state);
} else {
if (difference === codeDepth) { // Must be exact
state.code = false;
return t;
}
state.formatting = previousFormatting;
return getType(state);
}
} else if (state.code) {
return getType(state);
}
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
stream.match(/\[[^\]]*\]/);
state.inline = state.f = linkHref;
return image;
}
if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) {
state.linkText = true;
if (modeCfg.highlightFormatting) state.formatting = "link";
return getType(state);
}
if (ch === ']' && state.linkText && stream.match(/\(.*\)| ?\[.*\]/, false)) {
if (modeCfg.highlightFormatting) state.formatting = "link";
var type = getType(state);
state.linkText = false;
state.inline = state.f = linkHref;
return type;
}
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
state.f = state.inline = linkInline;
if (modeCfg.highlightFormatting) state.formatting = "link";
var type = getType(state);
if (type){
type += " ";
} else {
type = "";
}
return type + linkinline;
}
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
state.f = state.inline = linkInline;
if (modeCfg.highlightFormatting) state.formatting = "link";
var type = getType(state);
if (type){
type += " ";
} else {
type = "";
}
return type + linkemail;
}
if (ch === '<' && stream.match(/^\w/, false)) {
if (stream.string.indexOf(">") != -1) {
var atts = stream.string.substring(1,stream.string.indexOf(">"));
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) {
state.md_inside = true;
}
}
stream.backUp(1);
state.htmlState = CodeMirror.startState(htmlMode);
return switchBlock(stream, state, htmlBlock);
}
if (ch === '<' && stream.match(/^\/\w*?>/)) {
state.md_inside = false;
return "tag";
}
var ignoreUnderscore = false;
if (!modeCfg.underscoresBreakWords) {
if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) {
var prevPos = stream.pos - 2;
if (prevPos >= 0) {
var prevCh = stream.string.charAt(prevPos);
if (prevCh !== '_' && prevCh.match(/(\w)/, false)) {
ignoreUnderscore = true;
}
}
}
}
if (ch === '*' || (ch === '_' && !ignoreUnderscore)) {
if (sol && stream.peek() === ' ') {
// Do nothing, surrounded by newline and space
} else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG
if (modeCfg.highlightFormatting) state.formatting = "strong";
var t = getType(state);
state.strong = false;
return t;
} else if (!state.strong && stream.eat(ch)) { // Add STRONG
state.strong = ch;
if (modeCfg.highlightFormatting) state.formatting = "strong";
return getType(state);
} else if (state.em === ch) { // Remove EM
if (modeCfg.highlightFormatting) state.formatting = "em";
var t = getType(state);
state.em = false;
return t;
} else if (!state.em) { // Add EM
state.em = ch;
if (modeCfg.highlightFormatting) state.formatting = "em";
return getType(state);
}
} else if (ch === ' ') {
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
return getType(state);
} else { // Not surrounded by spaces, back up pointer
stream.backUp(1);
}
}
}
if (modeCfg.strikethrough) {
if (ch === '~' && stream.eatWhile(ch)) {
if (state.strikethrough) {// Remove strikethrough
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
var t = getType(state);
state.strikethrough = false;
return t;
} else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
state.strikethrough = true;
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
return getType(state);
}
} else if (ch === ' ') {
if (stream.match(/^~~/, true)) { // Probably surrounded by space
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
return getType(state);
} else { // Not surrounded by spaces, back up pointer
stream.backUp(2);
}
}
}
}
if (ch === ' ') {
if (stream.match(/ +$/, false)) {
state.trailingSpace++;
} else if (state.trailingSpace) {
state.trailingSpaceNewLine = true;
}
}
return getType(state);
}
function linkInline(stream, state) {
var ch = stream.next();
if (ch === ">") {
state.f = state.inline = inlineNormal;
if (modeCfg.highlightFormatting) state.formatting = "link";
var type = getType(state);
if (type){
type += " ";
} else {
type = "";
}
return type + linkinline;
}
stream.match(/^[^>]+/, true);
return linkinline;
}
function linkHref(stream, state) {
// Check if space, and return NULL if so (to avoid marking the space)
if(stream.eatSpace()){
return null;
}
var ch = stream.next();
if (ch === '(' || ch === '[') {
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
if (modeCfg.highlightFormatting) state.formatting = "link-string";
state.linkHref = true;
return getType(state);
}
return 'error';
}
function getLinkHrefInside(endChar) {
return function(stream, state) {
var ch = stream.next();
if (ch === endChar) {
state.f = state.inline = inlineNormal;
if (modeCfg.highlightFormatting) state.formatting = "link-string";
var returnState = getType(state);
state.linkHref = false;
return returnState;
}
if (stream.match(inlineRE(endChar), true)) {
stream.backUp(1);
}
state.linkHref = true;
return getType(state);
};
}
function footnoteLink(stream, state) {
if (stream.match(/^[^\]]*\]:/, false)) {
state.f = footnoteLinkInside;
stream.next(); // Consume [
if (modeCfg.highlightFormatting) state.formatting = "link";
state.linkText = true;
return getType(state);
}
return switchInline(stream, state, inlineNormal);
}
function footnoteLinkInside(stream, state) {
if (stream.match(/^\]:/, true)) {
state.f = state.inline = footnoteUrl;
if (modeCfg.highlightFormatting) state.formatting = "link";
var returnType = getType(state);
state.linkText = false;
return returnType;
}
stream.match(/^[^\]]+/, true);
return linktext;
}
function footnoteUrl(stream, state) {
// Check if space, and return NULL if so (to avoid marking the space)
if(stream.eatSpace()){
return null;
}
// Match URL
stream.match(/^[^\s]+/, true);
// Check for link title
if (stream.peek() === undefined) { // End of line, set flag to check next line
state.linkTitle = true;
} else { // More content on line, check if link title
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
return linkhref + " url";
}
var savedInlineRE = [];
function inlineRE(endChar) {
if (!savedInlineRE[endChar]) {
// Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741)
endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
// Match any non-endChar, escaped character, as well as the closing
// endChar.
savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')');
}
return savedInlineRE[endChar];
}
var mode = {
startState: function() {
return {
f: blockNormal,
prevLineHasContent: false,
thisLineHasContent: false,
block: blockNormal,
htmlState: null,
indentation: 0,
inline: inlineNormal,
text: handleText,
formatting: false,
linkText: false,
linkHref: false,
linkTitle: false,
em: false,
strong: false,
header: 0,
hr: false,
taskList: false,
list: false,
listDepth: 0,
quote: 0,
trailingSpace: 0,
trailingSpaceNewLine: false,
strikethrough: false
};
},
copyState: function(s) {
return {
f: s.f,
prevLineHasContent: s.prevLineHasContent,
thisLineHasContent: s.thisLineHasContent,
block: s.block,
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
indentation: s.indentation,
localMode: s.localMode,
localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
inline: s.inline,
text: s.text,
formatting: false,
linkTitle: s.linkTitle,
em: s.em,
strong: s.strong,
strikethrough: s.strikethrough,
header: s.header,
hr: s.hr,
taskList: s.taskList,
list: s.list,
listDepth: s.listDepth,
quote: s.quote,
indentedCode: s.indentedCode,
trailingSpace: s.trailingSpace,
trailingSpaceNewLine: s.trailingSpaceNewLine,
md_inside: s.md_inside
};
},
token: function(stream, state) {
// Reset state.formatting
state.formatting = false;
if (stream.sol()) {
var forceBlankLine = !!state.header || state.hr;
// Reset state.header and state.hr
state.header = 0;
state.hr = false;
if (stream.match(/^\s*$/, true) || forceBlankLine) {
state.prevLineHasContent = false;
blankLine(state);
return forceBlankLine ? this.token(stream, state) : null;
} else {
state.prevLineHasContent = state.thisLineHasContent;
state.thisLineHasContent = true;
}
// Reset state.taskList
state.taskList = false;
// Reset state.code
state.code = false;
// Reset state.trailingSpace
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
state.f = state.block;
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
var difference = Math.floor((indentation - state.indentation) / 4) * 4;
if (difference > 4) difference = 4;
var adjustedIndentation = state.indentation + difference;
state.indentationDiff = adjustedIndentation - state.indentation;
state.indentation = adjustedIndentation;
if (indentation > 0) return null;
}
return state.f(stream, state);
},
innerMode: function(state) {
if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
if (state.localState) return {state: state.localState, mode: state.localMode};
return {state: state, mode: mode};
},
blankLine: blankLine,
getType: getType,
fold: "markdown"
};
return mode;
}, "xml");
CodeMirror.defineMIME("text/x-markdown", "markdown");
});

View File

@ -1,384 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("xml", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
var Kludges = parserConfig.htmlMode ? {
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
'track': true, 'wbr': true, 'menuitem': true},
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
'th': true, 'tr': true},
contextGrabbers: {
'dd': {'dd': true, 'dt': true},
'dt': {'dd': true, 'dt': true},
'li': {'li': true},
'option': {'option': true, 'optgroup': true},
'optgroup': {'optgroup': true},
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
'rp': {'rp': true, 'rt': true},
'rt': {'rp': true, 'rt': true},
'tbody': {'tbody': true, 'tfoot': true},
'td': {'td': true, 'th': true},
'tfoot': {'tbody': true},
'th': {'td': true, 'th': true},
'thead': {'tbody': true, 'tfoot': true},
'tr': {'tr': true}
},
doNotIndent: {"pre": true},
allowUnquoted: true,
allowMissing: true,
caseFold: true
} : {
autoSelfClosers: {},
implicitlyClosed: {},
contextGrabbers: {},
doNotIndent: {},
allowUnquoted: false,
allowMissing: false,
caseFold: false
};
var alignCDATA = parserConfig.alignCDATA;
// Return variables for tokenizers
var type, setStyle;
function inText(stream, state) {
function chain(parser) {
state.tokenize = parser;
return parser(stream, state);
}
var ch = stream.next();
if (ch == "<") {
if (stream.eat("!")) {
if (stream.eat("[")) {
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
else return null;
} else if (stream.match("--")) {
return chain(inBlock("comment", "-->"));
} else if (stream.match("DOCTYPE", true, true)) {
stream.eatWhile(/[\w\._\-]/);
return chain(doctype(1));
} else {
return null;
}
} else if (stream.eat("?")) {
stream.eatWhile(/[\w\._\-]/);
state.tokenize = inBlock("meta", "?>");
return "meta";
} else {
type = stream.eat("/") ? "closeTag" : "openTag";
state.tokenize = inTag;
return "tag bracket";
}
} else if (ch == "&") {
var ok;
if (stream.eat("#")) {
if (stream.eat("x")) {
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
} else {
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
}
} else {
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
}
return ok ? "atom" : "error";
} else {
stream.eatWhile(/[^&<]/);
return null;
}
}
function inTag(stream, state) {
var ch = stream.next();
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
state.tokenize = inText;
type = ch == ">" ? "endTag" : "selfcloseTag";
return "tag bracket";
} else if (ch == "=") {
type = "equals";
return null;
} else if (ch == "<") {
state.tokenize = inText;
state.state = baseState;
state.tagName = state.tagStart = null;
var next = state.tokenize(stream, state);
return next ? next + " tag error" : "tag error";
} else if (/[\'\"]/.test(ch)) {
state.tokenize = inAttribute(ch);
state.stringStartCol = stream.column();
return state.tokenize(stream, state);
} else {
stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
return "word";
}
}
function inAttribute(quote) {
var closure = function(stream, state) {
while (!stream.eol()) {
if (stream.next() == quote) {
state.tokenize = inTag;
break;
}
}
return "string";
};
closure.isInAttribute = true;
return closure;
}
function inBlock(style, terminator) {
return function(stream, state) {
while (!stream.eol()) {
if (stream.match(terminator)) {
state.tokenize = inText;
break;
}
stream.next();
}
return style;
};
}
function doctype(depth) {
return function(stream, state) {
var ch;
while ((ch = stream.next()) != null) {
if (ch == "<") {
state.tokenize = doctype(depth + 1);
return state.tokenize(stream, state);
} else if (ch == ">") {
if (depth == 1) {
state.tokenize = inText;
break;
} else {
state.tokenize = doctype(depth - 1);
return state.tokenize(stream, state);
}
}
}
return "meta";
};
}
function Context(state, tagName, startOfLine) {
this.prev = state.context;
this.tagName = tagName;
this.indent = state.indented;
this.startOfLine = startOfLine;
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
this.noIndent = true;
}
function popContext(state) {
if (state.context) state.context = state.context.prev;
}
function maybePopContext(state, nextTagName) {
var parentTagName;
while (true) {
if (!state.context) {
return;
}
parentTagName = state.context.tagName;
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
return;
}
popContext(state);
}
}
function baseState(type, stream, state) {
if (type == "openTag") {
state.tagStart = stream.column();
return tagNameState;
} else if (type == "closeTag") {
return closeTagNameState;
} else {
return baseState;
}
}
function tagNameState(type, stream, state) {
if (type == "word") {
state.tagName = stream.current();
setStyle = "tag";
return attrState;
} else {
setStyle = "error";
return tagNameState;
}
}
function closeTagNameState(type, stream, state) {
if (type == "word") {
var tagName = stream.current();
if (state.context && state.context.tagName != tagName &&
Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
popContext(state);
if (state.context && state.context.tagName == tagName) {
setStyle = "tag";
return closeState;
} else {
setStyle = "tag error";
return closeStateErr;
}
} else {
setStyle = "error";
return closeStateErr;
}
}
function closeState(type, _stream, state) {
if (type != "endTag") {
setStyle = "error";
return closeState;
}
popContext(state);
return baseState;
}
function closeStateErr(type, stream, state) {
setStyle = "error";
return closeState(type, stream, state);
}
function attrState(type, _stream, state) {
if (type == "word") {
setStyle = "attribute";
return attrEqState;
} else if (type == "endTag" || type == "selfcloseTag") {
var tagName = state.tagName, tagStart = state.tagStart;
state.tagName = state.tagStart = null;
if (type == "selfcloseTag" ||
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
maybePopContext(state, tagName);
} else {
maybePopContext(state, tagName);
state.context = new Context(state, tagName, tagStart == state.indented);
}
return baseState;
}
setStyle = "error";
return attrState;
}
function attrEqState(type, stream, state) {
if (type == "equals") return attrValueState;
if (!Kludges.allowMissing) setStyle = "error";
return attrState(type, stream, state);
}
function attrValueState(type, stream, state) {
if (type == "string") return attrContinuedState;
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
setStyle = "error";
return attrState(type, stream, state);
}
function attrContinuedState(type, stream, state) {
if (type == "string") return attrContinuedState;
return attrState(type, stream, state);
}
return {
startState: function() {
return {tokenize: inText,
state: baseState,
indented: 0,
tagName: null, tagStart: null,
context: null};
},
token: function(stream, state) {
if (!state.tagName && stream.sol())
state.indented = stream.indentation();
if (stream.eatSpace()) return null;
type = null;
var style = state.tokenize(stream, state);
if ((style || type) && style != "comment") {
setStyle = null;
state.state = state.state(type || style, stream, state);
if (setStyle)
style = setStyle == "error" ? style + " error" : setStyle;
}
return style;
},
indent: function(state, textAfter, fullLine) {
var context = state.context;
// Indent multi-line strings (e.g. css).
if (state.tokenize.isInAttribute) {
if (state.tagStart == state.indented)
return state.stringStartCol + 1;
else
return state.indented + indentUnit;
}
if (context && context.noIndent) return CodeMirror.Pass;
if (state.tokenize != inTag && state.tokenize != inText)
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
// Indent the starts of attribute names.
if (state.tagName) {
if (multilineTagIndentPastTag)
return state.tagStart + state.tagName.length + 2;
else
return state.tagStart + indentUnit * multilineTagIndentFactor;
}
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
if (tagAfter && tagAfter[1]) { // Closing tag spotted
while (context) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
} else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
context = context.prev;
} else {
break;
}
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
var grabbers = Kludges.contextGrabbers[context.tagName];
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
context = context.prev;
else
break;
}
}
while (context && !context.startOfLine)
context = context.prev;
if (context) return context.indent + indentUnit;
else return 0;
},
electricInput: /<\/[\s\w:]+>$/,
blockCommentStart: "<!--",
blockCommentEnd: "-->",
configuration: parserConfig.htmlMode ? "html" : "xml",
helperType: parserConfig.htmlMode ? "html" : "xml"
};
});
CodeMirror.defineMIME("text/xml", "xml");
CodeMirror.defineMIME("application/xml", "xml");
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
});

File diff suppressed because it is too large Load Diff

View File

@ -1,677 +0,0 @@
var isMac = /Mac/.test(navigator.platform);
var shortcuts = {
'Cmd-B': toggleBold,
'Cmd-I': toggleItalic,
'Cmd-K': drawLink,
'Cmd-Alt-I': drawImage,
"Cmd-'": toggleBlockquote,
'Cmd-Alt-L': toggleOrderedList,
'Cmd-L': toggleUnOrderedList
};
/**
* Fix shortcut. Mac use Command, others use Ctrl.
*/
function fixShortcut(name) {
if (isMac) {
name = name.replace('Ctrl', 'Cmd');
} else {
name = name.replace('Cmd', 'Ctrl');
}
return name;
}
/**
* Create icon element for toolbar.
*/
function createIcon(name, options) {
options = options || {};
var el = document.createElement('a');
var shortcut = options.shortcut || shortcuts[name];
if (shortcut) {
shortcut = fixShortcut(shortcut);
el.title = shortcut;
el.title = el.title.replace('Cmd', '⌘');
if (isMac) {
el.title = el.title.replace('Alt', '⌥');
}
}
el.className = options.className || 'icon-' + name;
return el;
}
function createSep() {
el = document.createElement('i');
el.className = 'separator';
el.innerHTML = '|';
return el;
}
/**
* The state of CodeMirror at the given position.
*/
function getState(cm, pos) {
pos = pos || cm.getCursor('start');
var stat = cm.getTokenAt(pos);
if (!stat.type) return {};
var types = stat.type.split(' ');
var ret = {},
data, text;
for (var i = 0; i < types.length; i++) {
data = types[i];
if (data === 'strong') {
ret.bold = true;
} else if (data === 'variable-2') {
text = cm.getLine(pos.line);
if (/^\s*\d+\.\s/.test(text)) {
ret['ordered-list'] = true;
} else {
ret['unordered-list'] = true;
}
} else if (data === 'atom') {
ret.quote = true;
} else if (data === 'em') {
ret.italic = true;
} else if (data === 'quote') {
ret.quote = true;
}
}
return ret;
}
/**
* Toggle full screen of the editor.
*/
function toggleFullScreen(editor) {
var el = editor.codemirror.getWrapperElement();
// https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
var doc = document;
var isFull = doc.fullScreen || doc.mozFullScreen || doc.webkitFullScreen;
var request = function() {
if (el.requestFullScreen) {
el.requestFullScreen();
} else if (el.mozRequestFullScreen) {
el.mozRequestFullScreen();
} else if (el.webkitRequestFullScreen) {
el.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
};
var cancel = function() {
if (doc.cancelFullScreen) {
doc.cancelFullScreen();
} else if (doc.mozCancelFullScreen) {
doc.mozCancelFullScreen();
} else if (doc.webkitCancelFullScreen) {
doc.webkitCancelFullScreen();
}
};
if (!isFull) {
request();
} else if (cancel) {
cancel();
}
}
/**
* Action for toggling bold.
*/
function toggleBold(editor) {
_toggleBlock(editor, 'bold', '**');
}
/**
* Action for toggling italic.
*/
function toggleItalic(editor) {
_toggleBlock(editor, 'italic', '*');
}
/**
* Action for toggling code block.
*/
function toggleCodeBlock(editor) {
_toggleBlock(editor, 'code', '```\r\n', '\r\n```');
}
/**
* Action for toggling blockquote.
*/
function toggleBlockquote(editor) {
var cm = editor.codemirror;
_toggleLine(cm, 'quote');
}
/**
* Action for toggling ul.
*/
function toggleUnOrderedList(editor) {
var cm = editor.codemirror;
_toggleLine(cm, 'unordered-list');
}
/**
* Action for toggling ol.
*/
function toggleOrderedList(editor) {
var cm = editor.codemirror;
_toggleLine(cm, 'ordered-list');
}
/**
* Action for drawing a link.
*/
function drawLink(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
_replaceSelection(cm, stat.link, '[', '](http://)');
}
/**
* Action for drawing an img.
*/
function drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
_replaceSelection(cm, stat.image, '![Short description of image](http://', ')');
}
/**
* Undo action.
*/
function undo(editor) {
var cm = editor.codemirror;
cm.undo();
cm.focus();
}
/**
* Redo action.
*/
function redo(editor) {
var cm = editor.codemirror;
cm.redo();
cm.focus();
}
/**
* Preview action.
*/
function togglePreview(editor) {
var toolbar = editor.toolbar.preview;
var parse = editor.constructor.markdown;
var cm = editor.codemirror;
var wrapper = cm.getWrapperElement();
var preview = wrapper.lastChild;
if (!/editor-preview/.test(preview.className)) {
preview = document.createElement('div');
preview.className = 'editor-preview';
wrapper.appendChild(preview);
}
if (/editor-preview-active/.test(preview.className)) {
preview.className = preview.className.replace(
/\s*editor-preview-active\s*/g, ''
);
toolbar.className = toolbar.className.replace(/\s*active\s*/g, '');
} else {
/* When the preview button is clicked for the first time,
* give some time for the transition from editor.css to fire and the view to slide from right to left,
* instead of just appearing.
*/
setTimeout(function() {
preview.className += ' editor-preview-active'
}, 1);
toolbar.className += ' active';
}
var text = cm.getValue();
preview.innerHTML = parse(text);
}
function _replaceSelection(cm, active, start, end) {
var text;
var startPoint = cm.getCursor('start');
var endPoint = cm.getCursor('end');
if (active) {
text = cm.getLine(startPoint.line);
start = text.slice(0, startPoint.ch);
end = text.slice(startPoint.ch);
cm.replaceRange(start + end, {
line: startPoint.line,
ch: 0
});
} else {
text = cm.getSelection();
cm.replaceSelection(start + text + end);
startPoint.ch += start.length;
endPoint.ch += start.length;
}
cm.setSelection(startPoint, endPoint);
cm.focus();
}
function _toggleLine(cm, name) {
var stat = getState(cm);
var startPoint = cm.getCursor('start');
var endPoint = cm.getCursor('end');
var repl = {
'quote': /^(\s*)\>\s+/,
'unordered-list': /^(\s*)(\*|\-|\+)\s+/,
'ordered-list': /^(\s*)\d+\.\s+/
};
var map = {
'quote': '> ',
'unordered-list': '* ',
'ordered-list': '1. '
};
for (var i = startPoint.line; i <= endPoint.line; i++) {
(function(i) {
var text = cm.getLine(i);
if (stat[name]) {
text = text.replace(repl[name], '$1');
} else {
text = map[name] + text;
}
cm.replaceRange(text, {
line: i,
ch: 0
}, {
line: i,
ch: 99999999999999
});
})(i);
}
cm.focus();
}
function _toggleBlock(editor, type, start_chars, end_chars) {
end_chars = (typeof end_chars === 'undefined') ? start_chars : end_chars;
var cm = editor.codemirror;
var stat = getState(cm);
var text;
var start = start_chars;
var end = end_chars;
var startPoint = cm.getCursor('start');
var endPoint = cm.getCursor('end');
if (stat[type]) {
text = cm.getLine(startPoint.line);
start = text.slice(0, startPoint.ch);
end = text.slice(startPoint.ch);
if (type == "bold") {
start = start.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/, "");
end = end.replace(/(\*\*|__)/, "");
} else if (type == "italic") {
start = start.replace(/(\*|_)(?![\s\S]*(\*|_))/, "");
end = end.replace(/(\*|_)/, "");
}
cm.replaceRange(start + end, {
line: startPoint.line,
ch: 0
}, {
line: startPoint.line,
ch: 99999999999999
});
startPoint.ch -= 2;
endPoint.ch -= 2;
} else {
text = cm.getSelection();
if (type == "bold") {
text = text.split("**").join("");
text = text.split("__").join("");
} else if (type == "italic") {
text = text.split("*").join("");
text = text.split("_").join("");
}
cm.replaceSelection(start + text + end);
startPoint.ch += start_chars.length;
endPoint.ch = startPoint.ch + text.length;
}
cm.setSelection(startPoint, endPoint);
cm.focus();
}
/* The right word count in respect for CJK. */
function wordCount(data) {
var pattern = /[a-zA-Z0-9_\u0392-\u03c9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
var m = data.match(pattern);
var count = 0;
if (m === null) return count;
for (var i = 0; i < m.length; i++) {
if (m[i].charCodeAt(0) >= 0x4E00) {
count += m[i].length;
} else {
count += 1;
}
}
return count;
}
var toolbar = [{
name: 'bold',
action: toggleBold,
className: "fa fa-bold"
}, {
name: 'italic',
action: toggleItalic,
className: "fa fa-italic"
},
'|',
{
name: 'quote',
action: toggleBlockquote,
className: "fa fa-quote-left"
}, {
name: 'unordered-list',
action: toggleUnOrderedList,
className: "fa fa-list-ul"
}, {
name: 'ordered-list',
action: toggleOrderedList,
className: "fa fa-list-ol"
},
'|',
{
name: 'link',
action: drawLink,
className: "fa fa-link"
}, {
name: 'image',
action: drawImage,
className: "fa fa-picture-o"
},
'|',
{
name: 'preview',
action: togglePreview,
className: "fa fa-eye"
},
];
/**
* Interface of Markdownify.
*/
function Markdownify(options) {
options = options || {};
if (options.element) {
this.element = options.element;
}
options.toolbar = options.toolbar || Markdownify.toolbar;
// you can customize toolbar with object
// [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}]
if (!options.hasOwnProperty('status')) {
options.status = ['lines', 'words', 'cursor'];
}
this.options = options;
// If user has passed an element, it should auto rendered
if (this.element) {
this.render();
}
}
/**
* Default toolbar elements.
*/
Markdownify.toolbar = toolbar;
/**
* Default markdown render.
*/
Markdownify.markdown = function(text) {
if (window.marked) {
// use marked as markdown parser
return marked(text);
}
};
/**
* Render editor to the given element.
*/
Markdownify.prototype.render = function(el) {
if (!el) {
el = this.element || document.getElementsByTagName('textarea')[0];
}
if (this._rendered && this._rendered === el) {
// Already rendered.
return;
}
this.element = el;
var options = this.options;
var self = this;
var keyMaps = {};
for (var key in shortcuts) {
(function(key) {
keyMaps[fixShortcut(key)] = function(cm) {
shortcuts[key](self);
};
})(key);
}
keyMaps["Enter"] = "newlineAndIndentContinueMarkdownList";
keyMaps['Tab'] = 'tabAndIndentContinueMarkdownList';
keyMaps['Shift-Tab'] = 'shiftTabAndIndentContinueMarkdownList';
this.codemirror = CodeMirror.fromTextArea(el, {
mode: 'markdown',
theme: 'paper',
tabSize: '2',
indentWithTabs: true,
lineNumbers: false,
autofocus: false,
extraKeys: keyMaps,
lineWrapping: true
});
if (options.toolbar !== false) {
this.createToolbar();
}
if (options.status !== false) {
this.createStatusbar();
}
this._rendered = this.element;
};
Markdownify.prototype.createToolbar = function(items) {
items = items || this.options.toolbar;
if (!items || items.length === 0) {
return;
}
var bar = document.createElement('div');
bar.className = 'editor-toolbar';
var self = this;
var el;
self.toolbar = {};
for (var i = 0; i < items.length; i++) {
(function(item) {
var el;
if (item.name) {
el = createIcon(item.name, item);
} else if (item === '|') {
el = createSep();
} else {
el = createIcon(item);
}
// bind events, special for info
if (item.action) {
if (typeof item.action === 'function') {
el.onclick = function(e) {
item.action(self);
};
} else if (typeof item.action === 'string') {
el.href = item.action;
el.target = '_blank';
}
}
self.toolbar[item.name || item] = el;
bar.appendChild(el);
})(items[i]);
}
var cm = this.codemirror;
cm.on('cursorActivity', function() {
var stat = getState(cm);
for (var key in self.toolbar) {
(function(key) {
var el = self.toolbar[key];
if (stat[key]) {
el.className += ' active';
} else {
el.className = el.className.replace(/\s*active\s*/g, '');
}
})(key);
}
});
var cmWrapper = cm.getWrapperElement();
cmWrapper.parentNode.insertBefore(bar, cmWrapper);
return bar;
};
Markdownify.prototype.createStatusbar = function(status) {
status = status || this.options.status;
if (!status || status.length === 0) return;
var bar = document.createElement('div');
bar.className = 'editor-statusbar';
var pos, cm = this.codemirror;
for (var i = 0; i < status.length; i++) {
(function(name) {
var el = document.createElement('span');
el.className = name;
if (name === 'words') {
el.innerHTML = '0';
cm.on('update', function() {
el.innerHTML = wordCount(cm.getValue());
});
} else if (name === 'lines') {
el.innerHTML = '0';
cm.on('update', function() {
el.innerHTML = cm.lineCount();
});
} else if (name === 'cursor') {
el.innerHTML = '0:0';
cm.on('cursorActivity', function() {
pos = cm.getCursor();
el.innerHTML = pos.line + ':' + pos.ch;
});
}
bar.appendChild(el);
})(status[i]);
}
var cmWrapper = this.codemirror.getWrapperElement();
cmWrapper.parentNode.insertBefore(bar, cmWrapper.nextSibling);
return bar;
};
/**
* Get or set the text content.
*/
Markdownify.prototype.value = function(val) {
if (val) {
this.codemirror.getDoc().setValue(val);
return this;
} else {
return this.codemirror.getValue();
}
};
/**
* Bind static methods for exports.
*/
Markdownify.toggleBold = toggleBold;
Markdownify.toggleItalic = toggleItalic;
Markdownify.toggleBlockquote = toggleBlockquote;
Markdownify.toggleUnOrderedList = toggleUnOrderedList;
Markdownify.toggleOrderedList = toggleOrderedList;
Markdownify.drawLink = drawLink;
Markdownify.drawImage = drawImage;
Markdownify.undo = undo;
Markdownify.redo = redo;
Markdownify.togglePreview = togglePreview;
Markdownify.toggleFullScreen = toggleFullScreen;
/**
* Bind instance methods for exports.
*/
Markdownify.prototype.toggleBold = function() {
toggleBold(this);
};
Markdownify.prototype.toggleItalic = function() {
toggleItalic(this);
};
Markdownify.prototype.toggleBlockquote = function() {
toggleBlockquote(this);
};
Markdownify.prototype.toggleUnOrderedList = function() {
toggleUnOrderedList(this);
};
Markdownify.prototype.toggleOrderedList = function() {
toggleOrderedList(this);
};
Markdownify.prototype.drawLink = function() {
drawLink(this);
};
Markdownify.prototype.drawImage = function() {
drawImage(this);
};
Markdownify.prototype.undo = function() {
undo(this);
};
Markdownify.prototype.redo = function() {
redo(this);
};
Markdownify.prototype.togglePreview = function() {
togglePreview(this);
};
Markdownify.prototype.toggleFullScreen = function() {
toggleFullScreen(this);
};

File diff suppressed because it is too large Load Diff

View File

@ -1,371 +0,0 @@
/* BASICS */
.CodeMirror {
}
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
z-index: 1;
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
/* DEFAULT THEME */
.cm-s-paper .cm-keyword {color: #555;}
.cm-s-paper .cm-atom {color: #7f8c8d;}
.cm-s-paper .cm-number {color: #7f8c8d;}
.cm-s-paper .cm-def {color: #00f;}
.cm-s-paper .cm-variable {color: black;}
.cm-s-paper .cm-variable-2 {color: #555;}
.cm-s-paper .cm-variable-3 {color: #085;}
.cm-s-paper .cm-property {color: black;}
.cm-s-paper .cm-operator {color: black;}
.cm-s-paper .cm-comment {color: #959595;}
.cm-s-paper .cm-string {color: #7f8c8d;}
.cm-s-paper .cm-string-2 {color: #f50;}
.cm-s-paper .cm-meta {color: #555;}
.cm-s-paper .cm-error {color: #f00;}
.cm-s-paper .cm-qualifier {color: #555;}
.cm-s-paper .cm-builtin {color: #555;}
.cm-s-paper .cm-bracket {color: #997;}
.cm-s-paper .cm-tag {color: #7f8c8d;}
.cm-s-paper .cm-attribute {color: #7f8c8d;}
.cm-s-paper .cm-header {color: #000;}
.cm-s-paper .cm-quote {color: #888;}
.cm-s-paper .cm-hr {color: #999;}
.cm-s-paper .cm-link {color: #7f8c8d;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px; padding-right: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
z-index: 6;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre-wrap;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {
display: inline-block;
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%; height: 0px;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-right: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #BDC3C7; }
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
visibility: hidden;
}
}
.CodeMirror .CodeMirror-code .cm-header-1{
font-size:200%;
line-height:200%;
}
.CodeMirror .CodeMirror-code .cm-header-2{
font-size:160%;
line-height:160%;
}
.CodeMirror .CodeMirror-code .cm-header-3{
font-size:125%;
line-height:125%;
}
.CodeMirror .CodeMirror-code .cm-header-4{
font-size:110%;
line-height:110%;
}
.CodeMirror .CodeMirror-code .cm-comment{
background:#eee;
border-radius:2px;
}
.CodeMirror {
height:auto;
min-height: 300px;
border:1px solid #ddd;
border-bottom-left-radius:4px;
border-bottom-right-radius:4px;
padding:10px;
}
:-webkit-full-screen {
background: #f9f9f5;
padding: 0.5em 1em;
width: 100%;
height: 100%;
}
:-moz-full-screen {
padding: 0.5em 1em;
background: #f9f9f5;
width: 100%;
height: 100%;
}
.editor-wrapper {
font: 16px/1.62 "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
color: #2c3e50;
}
/* this is the title */
.editor-wrapper input.title {
font: 18px "Helvetica Neue", "Xin Gothic", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
background: transparent;
padding: 4px;
width: 100%;
border: none;
outline: none;
opacity: 0.6;
}
.editor-toolbar {
position: relative;
opacity: 0.6;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
padding:0 10px;
border-top:1px solid #bbb;
border-left:1px solid #bbb;
border-right:1px solid #bbb;
border-top-left-radius:4px;
border-top-right-radius:4px;
}
.editor-toolbar:before, .editor-toolbar:after {
display: block;
content: ' ';
height: 1px;
}
.editor-toolbar:before {
margin-bottom: 8px;
}
.editor-toolbar:after {
margin-top: 8px;
}
.editor-wrapper input.title:hover, .editor-wrapper input.title:focus, .editor-toolbar:hover {
opacity: 0.8;
}
.editor-toolbar a {
display: inline-block;
text-align: center;
text-decoration: none !important;
color: #2c3e50 !important;
width:30px;
height:30px;
margin:0;
border: 1px solid transparent;
border-radius: 3px;
cursor: pointer;
}
.editor-toolbar a:hover, .editor-toolbar a.active {
background: #fcfcfc;
border-color: #95a5a6;
}
.editor-toolbar a:before {
line-height:30px;
}
.editor-toolbar i.separator {
display: inline-block;
width: 0;
border-left: 1px solid #d9d9d9;
border-right: 1px solid white;
color: transparent;
text-indent: -10px;
margin: 0 6px;
}
.editor-toolbar a.icon-fullscreen {
position: absolute;
right:10px;
}
.editor-statusbar {
padding: 8px 10px;
font-size: 12px;
color: #959694;
text-align: right;
}
.editor-statusbar span {
display: inline-block;
min-width: 4em;
margin-left: 1em;
}
.editor-statusbar .lines:before {
content: 'lines: ';
}
.editor-statusbar .words:before {
content: 'words: ';
}
.editor-preview {
padding:10px;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #fff;
z-index: 9999;
overflow: auto;
display:none;
}
.editor-preview-active {
display:block;
}
.editor-preview > p {
margin-top: 0;
}
.editor-preview pre{
background:#eee;
margin-bottom:10px;
}
.editor-preview table td, .editor-preview table th {
border: solid 1px #bbb;
padding: 5px;
}

403
src/css/easymde.css Normal file
View File

@ -0,0 +1,403 @@
.EasyMDEContainer {
display: block;
}
.CodeMirror-rtl pre {
direction: rtl;
}
.EasyMDEContainer.sided--no-fullscreen {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.EasyMDEContainer .CodeMirror {
box-sizing: border-box;
height: auto;
border: 1px solid #ced4da;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 10px;
font: inherit;
z-index: 0;
word-wrap: break-word;
}
.EasyMDEContainer .CodeMirror-scroll {
cursor: text;
}
.EasyMDEContainer .CodeMirror-fullscreen {
background: #fff;
position: fixed !important;
top: 50px;
left: 0;
right: 0;
bottom: 0;
height: auto;
z-index: 8;
border-right: none !important;
border-bottom-right-radius: 0 !important;
}
.EasyMDEContainer .CodeMirror-sided {
width: 50% !important;
}
.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided {
border-right: none !important;
border-bottom-right-radius: 0;
position: relative;
flex: 1 1 auto;
}
.EasyMDEContainer .CodeMirror-placeholder {
opacity: .5;
}
.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected {
background: #d9d9d9;
}
.editor-toolbar {
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
padding: 9px 10px;
border-top: 1px solid #ced4da;
border-left: 1px solid #ced4da;
border-right: 1px solid #ced4da;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.editor-toolbar.fullscreen {
width: 100%;
height: 50px;
padding-top: 10px;
padding-bottom: 10px;
box-sizing: border-box;
background: #fff;
border: 0;
position: fixed;
top: 0;
left: 0;
opacity: 1;
z-index: 9;
}
.editor-toolbar.fullscreen::before {
width: 20px;
height: 50px;
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
position: fixed;
top: 0;
left: 0;
margin: 0;
padding: 0;
}
.editor-toolbar.fullscreen::after {
width: 20px;
height: 50px;
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
position: fixed;
top: 0;
right: 0;
margin: 0;
padding: 0;
}
.EasyMDEContainer.sided--no-fullscreen .editor-toolbar {
width: 100%;
}
.editor-toolbar button, .editor-toolbar .easymde-dropdown {
background: transparent;
display: inline-block;
text-align: center;
text-decoration: none !important;
height: 30px;
margin: 0;
padding: 0;
border: 1px solid transparent;
border-radius: 3px;
cursor: pointer;
}
.editor-toolbar button {
font-weight: bold;
min-width: 30px;
padding: 0 6px;
white-space: nowrap;
}
.editor-toolbar button.active,
.editor-toolbar button:hover {
background: #fcfcfc;
border-color: #95a5a6;
}
.editor-toolbar i.separator {
display: inline-block;
width: 0;
border-left: 1px solid #d9d9d9;
border-right: 1px solid #fff;
color: transparent;
text-indent: -10px;
margin: 0 6px;
}
.editor-toolbar button:after {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 65%;
vertical-align: text-bottom;
position: relative;
top: 2px;
}
.editor-toolbar button.heading-1:after {
content: "1";
}
.editor-toolbar button.heading-2:after {
content: "2";
}
.editor-toolbar button.heading-3:after {
content: "3";
}
.editor-toolbar button.heading-bigger:after {
content: "▲";
}
.editor-toolbar button.heading-smaller:after {
content: "▼";
}
.editor-toolbar.disabled-for-preview button:not(.no-disable) {
opacity: .6;
pointer-events: none;
}
@media only screen and (max-width: 700px) {
.editor-toolbar i.no-mobile {
display: none;
}
}
.editor-statusbar {
padding: 8px 10px;
font-size: 12px;
color: #959694;
text-align: right;
}
.EasyMDEContainer.sided--no-fullscreen .editor-statusbar {
width: 100%;
}
.editor-statusbar span {
display: inline-block;
min-width: 4em;
margin-left: 1em;
}
.editor-statusbar .lines:before {
content: 'lines: '
}
.editor-statusbar .words:before {
content: 'words: '
}
.editor-statusbar .characters:before {
content: 'characters: '
}
.editor-preview-full {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 7;
overflow: auto;
display: none;
box-sizing: border-box;
}
.editor-preview-side {
position: fixed;
bottom: 0;
width: 50%;
top: 50px;
right: 0;
z-index: 9;
overflow: auto;
display: none;
box-sizing: border-box;
border: 1px solid #ddd;
word-wrap: break-word;
}
.editor-preview-active-side {
display: block
}
.EasyMDEContainer.sided--no-fullscreen .editor-preview-active-side {
flex: 1 1 auto;
height: auto;
position: static;
}
.editor-preview-active {
display: block
}
.editor-preview {
padding: 10px;
background: #fafafa;
}
.editor-preview > p {
margin-top: 0
}
.editor-preview pre {
background: #eee;
margin-bottom: 10px;
}
.editor-preview table td,
.editor-preview table th {
border: 1px solid #ddd;
padding: 5px;
}
.cm-s-easymde .cm-tag {
color: #63a35c;
}
.cm-s-easymde .cm-attribute {
color: #795da3;
}
.cm-s-easymde .cm-string {
color: #183691;
}
.cm-s-easymde .cm-header-1 {
font-size: calc(1.375rem + 1.5vw);
}
.cm-s-easymde .cm-header-2 {
font-size: calc(1.325rem + .9vw);
}
.cm-s-easymde .cm-header-3 {
font-size: calc(1.3rem + .6vw);
}
.cm-s-easymde .cm-header-4 {
font-size: calc(1.275rem + .3vw);
}
.cm-s-easymde .cm-header-5 {
font-size: 1.25rem;
}
.cm-s-easymde .cm-header-6 {
font-size: 1rem;
}
.cm-s-easymde .cm-header-1,
.cm-s-easymde .cm-header-2,
.cm-s-easymde .cm-header-3,
.cm-s-easymde .cm-header-4,
.cm-s-easymde .cm-header-5,
.cm-s-easymde .cm-header-6 {
margin-bottom: .5rem;
line-height: 1.2;
}
.cm-s-easymde .cm-comment {
background: rgba(0, 0, 0, .05);
border-radius: 2px;
}
.cm-s-easymde .cm-link {
color: #7f8c8d;
}
.cm-s-easymde .cm-url {
color: #aab2b3;
}
.cm-s-easymde .cm-quote {
color: #7f8c8d;
font-style: italic;
}
.editor-toolbar .easymde-dropdown {
position: relative;
background: linear-gradient(to bottom right, #fff 0%, #fff 84%, #333 50%, #333 100%);
border-radius: 0;
border: 1px solid #fff;
}
.editor-toolbar .easymde-dropdown:hover {
background: linear-gradient(to bottom right, #fff 0%, #fff 84%, #333 50%, #333 100%);
}
.easymde-dropdown-content {
display: block;
visibility: hidden;
position: absolute;
background-color: #f9f9f9;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
padding: 8px;
z-index: 2;
top: 30px;
}
.easymde-dropdown:active .easymde-dropdown-content,
.easymde-dropdown:focus .easymde-dropdown-content,
.easymde-dropdown:focus-within .easymde-dropdown-content {
visibility: visible;
}
.easymde-dropdown-content button {
display: block;
}
span[data-img-src]::after {
content: '';
/*noinspection CssUnresolvedCustomProperty, added through JS*/
background-image: var(--bg-image);
display: block;
max-height: 100%;
max-width: 100%;
background-size: contain;
height: 0;
/*noinspection CssUnresolvedCustomProperty, added through JS*/
padding-top: var(--height);
/*noinspection CssUnresolvedCustomProperty, added through JS*/
width: var(--width);
background-repeat: no-repeat;
}

View File

@ -0,0 +1,42 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
var CodeMirror = require('codemirror');
CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
var ranges = cm.listSelections();
var pos = ranges[0].head;
var eolState = cm.getStateAfter(pos.line);
var inList = eolState.list !== false;
if (inList) {
cm.execCommand('indentMore');
return;
}
if (cm.options.indentWithTabs) {
cm.execCommand('insertTab');
} else {
var spaces = Array(cm.options.tabSize + 1).join(' ');
cm.replaceSelection(spaces);
}
};
CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
var ranges = cm.listSelections();
var pos = ranges[0].head;
var eolState = cm.getStateAfter(pos.line);
var inList = eolState.list !== false;
if (inList) {
cm.execCommand('indentLess');
return;
}
if (cm.options.indentWithTabs) {
cm.execCommand('insertTab');
} else {
var spaces = Array(cm.options.tabSize + 1).join(' ');
cm.replaceSelection(spaces);
}
};

3052
src/js/easymde.js Normal file

File diff suppressed because it is too large Load Diff

238
types/easymde-test.ts Normal file
View File

@ -0,0 +1,238 @@
// Create new instance
import EasyMDE = require('./easymde');
const editor = new EasyMDE({
autoDownloadFontAwesome: false,
element: document.getElementById('mdEditor')!,
hideIcons: ['side-by-side', 'fullscreen'],
inputStyle: 'textarea',
shortcuts: {
drawTable: 'Cmd-Alt-T',
toggleFullScreen: null,
},
previewClass: 'my-custom-class',
spellChecker: false,
onToggleFullScreen: (full: boolean) => {
console.log('FullscreenToggled', full);
},
theme: 'someOtherTheme',
minHeight: '200px',
});
// Editor functions
const value = editor.value() as string;
editor.value(value.toUpperCase());
const sbs = editor.isSideBySideActive() as boolean;
const fullscreen = editor.isFullscreenActive() as boolean;
// Access to codemirror object
editor.codemirror.setOption('readOnly', true);
// Static properties
EasyMDE.toggleItalic = (editor: EasyMDE) => {
console.log('SomeButtonOverride');
};
const editor2 = new EasyMDE({
autoDownloadFontAwesome: undefined,
previewClass: ['my-custom-class', 'some-other-class'],
nativeSpellcheck: true,
unorderedListStyle: '-',
inputStyle: 'contenteditable',
toolbar: [
{
name: 'bold',
action: EasyMDE.toggleBold,
className: 'fa fas fa-bolt',
title: 'Bold',
},
'|',
'undo',
{
name: 'alert',
action: (editor: EasyMDE) => {
alert('This is from a custom button action!');
// Custom functions have access to the `editor` instance.
},
className: 'fa fas fa-star',
title: 'A Custom Button',
noDisable: undefined,
noMobile: false,
attributes: {
'data-custom': 'attribute',
}
},
'|',
{
name: 'link',
action: 'https://github.com/Ionaru/easy-markdown-editor',
className: 'fa fab fa-github',
title: 'A Custom Link',
noDisable: true,
noMobile: true,
},
'preview',
{
name: 'links',
className: 'fa fas fa-arrow-down',
title: 'A Custom Link',
children: [
{
name: 'link',
action: 'https://github.com/Ionaru/easy-markdown-editor',
className: 'fa fab fa-github',
title: 'A Custom Link',
noDisable: true,
noMobile: true,
},
'preview',
{
name: 'bold',
action: EasyMDE.toggleBold,
className: 'fa fas fa-bold',
title: 'Bold',
attributes: {
'data-custom': 'some value',
'data-custom-2': 'another value',
}
},
],
},
],
});
editor2.clearAutosavedValue();
editor2.updateStatusBar('upload-image', 'Drag & drop images!');
EasyMDE.togglePreview(editor2);
EasyMDE.toggleSideBySide(editor2);
const editorImages = new EasyMDE({
uploadImage: true,
previewImagesInEditor: false,
imageAccept: 'image/png, image/bmp',
imageCSRFToken: undefined,
unorderedListStyle: '+',
imageMaxSize: 10485760,
imageUploadEndpoint: 'https://my.domain/image-upload/',
imageTexts: {
sbInit: 'Drag & drop images!',
sbOnDragEnter: 'Let it go, let it go',
sbOnDrop: 'Uploading...',
sbProgress: 'Uploading... (#progress#)',
sbOnUploaded: 'Upload complete!',
sizeUnits: 'b,Kb,Mb',
},
errorMessages: {
noFileGiven: 'Please select a file',
typeNotAllowed: 'This file type is not allowed!',
fileTooLarge: 'Image too big',
importError: 'Something went oops!',
},
errorCallback: errorMessage => {
console.error(errorMessage);
},
});
const editorImagesCustom = new EasyMDE({
uploadImage: true,
imageAccept: 'image/png, image/bmp',
imageCSRFToken: undefined,
imageMaxSize: 10485760,
imageUploadFunction: (file: File, onSuccess, onError) => {
console.log(file);
onSuccess('http://image.url/9.png');
onError('Failed because reasons.');
},
imageTexts: {
sbInit: 'Drag & drop images!',
sbOnDragEnter: 'Let it go, let it go',
sbOnDrop: 'Uploading...',
sbProgress: 'Uploading... (#progress#)',
sbOnUploaded: 'Upload complete!',
sizeUnits: 'b,Kb,Mb',
},
errorMessages: {
noFileGiven: 'Please select a file',
typeNotAllowed: 'This file type is not allowed!',
fileTooLarge: 'Image too big',
importError: 'Something went oops!',
},
errorCallback: errorMessage => {
console.error(errorMessage);
},
renderingConfig: {
codeSyntaxHighlighting: true,
markedOptions: {
silent: true,
highlight(code: string, lang: string, callback?: (error: (any | undefined), code: string) => void): string {
return 'something';
},
},
},
promptTexts: {
image: 'Insert URL',
},
syncSideBySidePreviewScroll: true,
});
new EasyMDE({
toolbarButtonClassPrefix: 'mde',
sideBySideFullscreen: true,
lineNumbers: false,
unorderedListStyle: '*',
autosave: {
enabled: true,
delay: 2000,
submit_delay: 10000,
uniqueId: 'abc',
timeFormat: {
locale: 'en-GB',
format: {
month: 'long',
},
},
text: 'Stored: ',
},
});
new EasyMDE({
sideBySideFullscreen: false,
lineNumbers: true,
maxHeight: '500px',
toolbar: [
'bold',
'italic',
'heading',
'|',
'quote',
'unordered-list',
'ordered-list',
'table',
'upload-image',
'|',
'link',
],
});
new EasyMDE({
direction: 'ltr',
});
new EasyMDE({
direction: 'rtl',
});
new EasyMDE({
previewRender: (plainText: string) => {
return '<pre>' + plainText + '</pre>';
}
});
new EasyMDE({
previewRender: (plainText: string, preview) => {
preview.innerHTML = '<pre>' + plainText + '</pre>';
return null;
}
});

294
types/easymde.d.ts vendored Normal file
View File

@ -0,0 +1,294 @@
// This file is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/simplemde/index.d.ts,
// which is written by Scalesoft <https://github.com/Scalesoft> and licensed under the MIT license:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
/// <reference types="codemirror"/>
import { marked } from 'marked';
interface ArrayOneOrMore<T> extends Array<T> {
0: T;
}
type ToolbarButton =
'bold'
| 'italic'
| 'quote'
| 'unordered-list'
| 'ordered-list'
| 'link'
| 'image'
| 'upload-image'
| 'strikethrough'
| 'code'
| 'table'
| 'redo'
| 'heading'
| 'undo'
| 'heading-bigger'
| 'heading-smaller'
| 'heading-1'
| 'heading-2'
| 'heading-3'
| 'clean-block'
| 'horizontal-rule'
| 'preview'
| 'side-by-side'
| 'fullscreen'
| 'guide';
declare namespace EasyMDE {
interface TimeFormatOptions {
locale?: string | string[];
format?: Intl.DateTimeFormatOptions;
}
interface AutoSaveOptions {
enabled?: boolean;
delay?: number;
submit_delay?: number;
uniqueId: string;
timeFormat?: TimeFormatOptions;
text?: string;
}
interface BlockStyleOptions {
bold?: string;
code?: string;
italic?: string;
}
interface CustomAttributes {
[key: string]: string;
}
interface InsertTextOptions {
horizontalRule?: ReadonlyArray<string>;
image?: ReadonlyArray<string>;
link?: ReadonlyArray<string>;
table?: ReadonlyArray<string>;
}
interface ParsingOptions {
allowAtxHeaderWithoutSpace?: boolean;
strikethrough?: boolean;
underscoresBreakWords?: boolean;
}
interface PromptTexts {
image?: string;
link?: string;
}
interface RenderingOptions {
codeSyntaxHighlighting?: boolean;
hljs?: any;
markedOptions?: marked.MarkedExtension;
sanitizerFunction?: (html: string) => string;
singleLineBreaks?: boolean;
}
interface Shortcuts {
[action: string]: string | undefined | null;
toggleBlockquote?: string | null;
toggleBold?: string | null;
cleanBlock?: string | null;
toggleHeadingSmaller?: string | null;
toggleItalic?: string | null;
drawLink?: string | null;
toggleUnorderedList?: string | null;
togglePreview?: string | null;
toggleCodeBlock?: string | null;
drawImage?: string | null;
toggleOrderedList?: string | null;
toggleHeadingBigger?: string | null;
toggleSideBySide?: string | null;
toggleFullScreen?: string | null;
}
interface StatusBarItem {
className: string;
defaultValue: (element: HTMLElement) => void;
onUpdate: (element: HTMLElement) => void;
}
interface ToolbarDropdownIcon {
name: string;
children: ArrayOneOrMore<ToolbarIcon | ToolbarButton>;
className: string;
title: string;
noDisable?: boolean;
noMobile?: boolean;
}
interface ToolbarIcon {
name: string;
action: string | ((editor: EasyMDE) => void);
className: string;
title: string;
noDisable?: boolean;
noMobile?: boolean;
icon?: string;
attributes?: CustomAttributes;
}
interface ImageTextsOptions {
sbInit?: string;
sbOnDragEnter?: string;
sbOnDrop?: string;
sbProgress?: string;
sbOnUploaded?: string;
sizeUnits?: string;
}
interface ImageErrorTextsOptions {
noFileGiven?: string;
typeNotAllowed?: string;
fileTooLarge?: string;
importError?: string;
}
interface OverlayModeOptions {
mode: CodeMirror.Mode<any>;
combine?: boolean;
}
interface SpellCheckerOptions {
codeMirrorInstance: CodeMirror.Editor;
}
interface Options {
autoDownloadFontAwesome?: boolean;
autofocus?: boolean;
autosave?: AutoSaveOptions;
autoRefresh?: boolean | { delay: number; };
blockStyles?: BlockStyleOptions;
element?: HTMLElement;
forceSync?: boolean;
hideIcons?: ReadonlyArray<ToolbarButton>;
indentWithTabs?: boolean;
initialValue?: string;
insertTexts?: InsertTextOptions;
lineNumbers?: boolean;
lineWrapping?: boolean;
minHeight?: string;
maxHeight?: string;
parsingConfig?: ParsingOptions;
placeholder?: string;
previewClass?: string | ReadonlyArray<string>;
previewImagesInEditor?: boolean;
imagesPreviewHandler?: (src: string) => string,
previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string | null;
promptURLs?: boolean;
renderingConfig?: RenderingOptions;
shortcuts?: Shortcuts;
showIcons?: ReadonlyArray<ToolbarButton>;
spellChecker?: boolean | ((options: SpellCheckerOptions) => void);
inputStyle?: 'textarea' | 'contenteditable';
nativeSpellcheck?: boolean;
sideBySideFullscreen?: boolean;
status?: boolean | ReadonlyArray<string | StatusBarItem>;
styleSelectedText?: boolean;
tabSize?: number;
toolbar?: boolean | ReadonlyArray<'|' | ToolbarButton | ToolbarIcon | ToolbarDropdownIcon>;
toolbarTips?: boolean;
toolbarButtonClassPrefix?: string;
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
theme?: string;
scrollbarStyle?: string;
unorderedListStyle?: '*' | '-' | '+';
uploadImage?: boolean;
imageMaxSize?: number;
imageAccept?: string;
imageUploadFunction?: (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => void;
imageUploadEndpoint?: string;
imagePathAbsolute?: boolean;
imageCSRFToken?: string;
imageCSRFName?: string;
imageCSRFHeader?: boolean;
imageTexts?: ImageTextsOptions;
imageInputName?: string
errorMessages?: ImageErrorTextsOptions;
errorCallback?: (errorMessage: string) => void;
promptTexts?: PromptTexts;
syncSideBySidePreviewScroll?: boolean;
overlayMode?: OverlayModeOptions;
direction?: 'ltr' | 'rtl';
}
}
declare class EasyMDE {
constructor(options?: EasyMDE.Options);
value(): string;
value(val: string): void;
codemirror: CodeMirror.Editor;
cleanup(): void;
toTextArea(): void;
isPreviewActive(): boolean;
isSideBySideActive(): boolean;
isFullscreenActive(): boolean;
clearAutosavedValue(): void;
updateStatusBar(itemName: string, content: string): void;
static toggleBold: (editor: EasyMDE) => void;
static toggleItalic: (editor: EasyMDE) => void;
static toggleStrikethrough: (editor: EasyMDE) => void;
static toggleHeadingSmaller: (editor: EasyMDE) => void;
static toggleHeadingBigger: (editor: EasyMDE) => void;
static toggleHeading1: (editor: EasyMDE) => void;
static toggleHeading2: (editor: EasyMDE) => void;
static toggleHeading3: (editor: EasyMDE) => void;
static toggleHeading4: (editor: EasyMDE) => void;
static toggleHeading5: (editor: EasyMDE) => void;
static toggleHeading6: (editor: EasyMDE) => void;
static toggleCodeBlock: (editor: EasyMDE) => void;
static toggleBlockquote: (editor: EasyMDE) => void;
static toggleUnorderedList: (editor: EasyMDE) => void;
static toggleOrderedList: (editor: EasyMDE) => void;
static cleanBlock: (editor: EasyMDE) => void;
static drawLink: (editor: EasyMDE) => void;
static drawImage: (editor: EasyMDE) => void;
static drawUploadedImage: (editor: EasyMDE) => void;
static drawTable: (editor: EasyMDE) => void;
static drawHorizontalRule: (editor: EasyMDE) => void;
static togglePreview: (editor: EasyMDE) => void;
static toggleSideBySide: (editor: EasyMDE) => void;
static toggleFullScreen: (editor: EasyMDE) => void;
static undo: (editor: EasyMDE) => void;
static redo: (editor: EasyMDE) => void;
}
export as namespace EasyMDE;
export = EasyMDE;

9
types/tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es3",
"ignoreDeprecations": "5.0",
"strict": true,
"noImplicitReturns": true,
"noEmit": true
}
}