You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -77,10 +77,14 @@ simplemde.value("This text will appear in the editor");
77
77
-**hideIcons**: An array of icon names to hide. Can be used to hide specific icons without completely customizing the toolbar.
78
78
-**indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
79
79
-**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
80
84
-**lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
81
85
-**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`.
84
88
-**underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`.
85
89
-**previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
86
90
-**renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
@@ -94,6 +98,7 @@ simplemde.value("This text will appear in the editor");
94
98
-**toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
95
99
96
100
```JavaScript
101
+
// Most options demonstrate the non-default behavior
97
102
var simplemde =newSimpleMDE({
98
103
autofocus:true,
99
104
autosave: {
@@ -105,6 +110,11 @@ var simplemde = new SimpleMDE({
105
110
hideIcons: ["guide", "heading"],
106
111
indentWithTabs:false,
107
112
initialValue:"Hello world!",
113
+
insertTexts: {
114
+
horizontalRule: ["", "\n\n-----\n\n"],
115
+
image: [""],
116
+
link: ["[", "](http://)"],
117
+
},
108
118
lineWrapping:false,
109
119
parsingConfig: {
110
120
allowAtxHeaderWithoutSpace:true,
@@ -136,7 +146,7 @@ var simplemde = new SimpleMDE({
136
146
137
147
#### Toolbar icons
138
148
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.
140
150
141
151
Name | Action | Tooltip<br>Class
142
152
:--- | :----- | :--------------
@@ -173,7 +183,7 @@ var simplemde = new SimpleMDE({
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)));
0 commit comments