Skip to content

Commit dab0b6b

Browse files
committed
Merge pull request sparksuite#155 from NextStepWebs/development
New option, HTML highlighting, Gulp build tweaks, Fix bugs
2 parents 0e6e466 + b98ad3f commit dab0b6b

File tree

11 files changed

+390
-178
lines changed

11 files changed

+390
-178
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ simplemde.value("This text will appear in the editor");
7777
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons without completely customizing the toolbar.
7878
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
7979
- **initialValue**: If set, will customize the initial value of the editor.
80+
- **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://)"]`.
81+
- horizontalRule
82+
- image
83+
- link
8084
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
8185
- **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing).
82-
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
83-
- **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`.
86+
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
87+
- **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`.
8488
- **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`.
8589
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
8690
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
@@ -94,6 +98,7 @@ simplemde.value("This text will appear in the editor");
9498
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
9599

96100
```JavaScript
101+
// Most options demonstrate the non-default behavior
97102
var simplemde = new SimpleMDE({
98103
autofocus: true,
99104
autosave: {
@@ -105,6 +110,11 @@ var simplemde = new SimpleMDE({
105110
hideIcons: ["guide", "heading"],
106111
indentWithTabs: false,
107112
initialValue: "Hello world!",
113+
insertTexts: {
114+
horizontalRule: ["", "\n\n-----\n\n"],
115+
image: ["![](http://", ")"],
116+
link: ["[", "](http://)"],
117+
},
108118
lineWrapping: false,
109119
parsingConfig: {
110120
allowAtxHeaderWithoutSpace: true,
@@ -136,7 +146,7 @@ var simplemde = new SimpleMDE({
136146

137147
#### Toolbar icons
138148

139-
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 JS. "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. The `Ctrl` and `Alt` in the title tags will be changed automatically to their Mac equivalents when needed. Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array.
149+
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 JS. "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. Any `Ctrl` or `Alt` in the title tags will be converted automatically to their Mac equivalents when needed. Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array.
140150

141151
Name | Action | Tooltip<br>Class
142152
:--- | :----- | :--------------
@@ -173,7 +183,7 @@ var simplemde = new SimpleMDE({
173183
var simplemde = new SimpleMDE({
174184
toolbar: [{
175185
name: "bold",
176-
action: toggleBold,
186+
action: SimpleMDE.toggleBold,
177187
className: "fa fa-bold",
178188
title: "Bold (Ctrl+B)",
179189
},

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simplemde",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
55
"authors": [
66
"Wes Cossick"

debug/simplemde.css

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* simplemde v1.8.1
3+
* Copyright Next Step Webs, Inc.
4+
* @link https://github.com/NextStepWebs/simplemde-markdown-editor
5+
* @license MIT
6+
*/
17
/* BASICS */
28

39
.CodeMirror {
@@ -421,13 +427,12 @@ span.CodeMirror-selectedtext { background: none; }
421427
.editor-toolbar.fullscreen::before {
422428
width: 20px;
423429
height: 50px;
424-
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(125, 185, 232, 0.01) 100%);
425-
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(125, 185, 232, 0.01)));
426-
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(125, 185, 232, 0.01) 100%);
427-
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(125, 185, 232, 0.01) 100%);
428-
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(125, 185, 232, 0.01) 100%);
429-
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(125, 185, 232, 0.01) 100%);
430-
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#037db9e8', GradientType=1);
430+
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
431+
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
432+
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
433+
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
434+
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
435+
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
431436
position: fixed;
432437
top: 0;
433438
left: 0;
@@ -438,13 +443,12 @@ span.CodeMirror-selectedtext { background: none; }
438443
.editor-toolbar.fullscreen::after {
439444
width: 20px;
440445
height: 50px;
441-
background: -moz-linear-gradient(left, rgba(125, 185, 232, 0.01) 0%, rgba(254, 254, 255, 1) 99%, rgba(255, 255, 255, 1) 100%);
442-
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(125, 185, 232, 0.01)), color-stop(99%, rgba(254, 254, 255, 1)), color-stop(100%, rgba(255, 255, 255, 1)));
443-
background: -webkit-linear-gradient(left, rgba(125, 185, 232, 0.01) 0%, rgba(254, 254, 255, 1) 99%, rgba(255, 255, 255, 1) 100%);
444-
background: -o-linear-gradient(left, rgba(125, 185, 232, 0.01) 0%, rgba(254, 254, 255, 1) 99%, rgba(255, 255, 255, 1) 100%);
445-
background: -ms-linear-gradient(left, rgba(125, 185, 232, 0.01) 0%, rgba(254, 254, 255, 1) 99%, rgba(255, 255, 255, 1) 100%);
446-
background: linear-gradient(to right, rgba(125, 185, 232, 0.01) 0%, rgba(254, 254, 255, 1) 99%, rgba(255, 255, 255, 1) 100%);
447-
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#037db9e8', endColorstr='#ffffff', GradientType=1);
446+
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
447+
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
448+
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
449+
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
450+
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
451+
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
448452
position: fixed;
449453
top: 0;
450454
right: 0;
@@ -603,6 +607,18 @@ span.CodeMirror-selectedtext { background: none; }
603607
padding: 5px;
604608
}
605609

610+
.CodeMirror .CodeMirror-code .cm-tag {
611+
color: #63a35c;
612+
}
613+
614+
.CodeMirror .CodeMirror-code .cm-attribute {
615+
color: #795da3;
616+
}
617+
618+
.CodeMirror .CodeMirror-code .cm-string {
619+
color: #183691;
620+
}
621+
606622
.CodeMirror .CodeMirror-selected {
607623
background: #d9d9d9;
608624
}
@@ -643,6 +659,6 @@ span.CodeMirror-selectedtext { background: none; }
643659
.CodeMirror .CodeMirror-code .cm-strikethrough {
644660
text-decoration: line-through;
645661
}
646-
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment) {
662+
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
647663
background: rgba(255, 0, 0, .15);
648664
}

0 commit comments

Comments
 (0)