mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-31 05:44:28 -06:00
Add modifications suggested in code review
This commit is contained in:
parent
7f7554effd
commit
c46ddde5e0
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Hey, welcome to the party! 🎉
|
Hey, welcome to the party! 🎉
|
||||||
|
|
||||||
Thank you so much to contribute to EasyMDE. 😘
|
Thank you so much for contributing to EasyMDE. 😘
|
||||||
|
|
||||||
|
|
||||||
## Asking questions, suggesting wonderful ideas or reporting bugs
|
## Asking questions, suggesting wonderful ideas or reporting bugs
|
||||||
@ -12,7 +12,7 @@ You can [submit an issue️](https://github.com/Ionaru/easy-markdown-editor/issu
|
|||||||
|
|
||||||
## Coding
|
## Coding
|
||||||
|
|
||||||
### 📦 Prerequies
|
### 📦 Prerequisites
|
||||||
|
|
||||||
You need node.js and npm.
|
You need node.js and npm.
|
||||||
|
|
||||||
@ -39,13 +39,7 @@ git clone https://github.com/Ionaru/easy-markdown-editor.git
|
|||||||
Then install the EasyMDE for development environment with npm:
|
Then install the EasyMDE for development environment with npm:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --save-dev
|
npm install
|
||||||
```
|
|
||||||
|
|
||||||
And check that everything is ok by running Gulp:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gulp
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Yay! You are ready! 🍾
|
Yay! You are ready! 🍾
|
||||||
|
24
README.md
24
README.md
@ -124,7 +124,7 @@ easyMDE.value('New input for **EasyMDE**');
|
|||||||
- **bold**: Can be set to `**` or `__`. Defaults to `**`.
|
- **bold**: Can be set to `**` or `__`. Defaults to `**`.
|
||||||
- **code**: Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
- **code**: Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
||||||
- **italic**: Can be set to `*` or `_`. Defaults to `*`.
|
- **italic**: Can be set to `*` or `_`. Defaults to `*`.
|
||||||
- **element**: The DOM element for the text area to use. Defaults to the first text area on the page.
|
- **element**: The DOM element for the TextArea to use. Defaults to the first TextArea 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`.
|
- **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.
|
- **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`.
|
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
||||||
@ -175,11 +175,11 @@ var editor = new EasyMDE({
|
|||||||
autosave: {
|
autosave: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
uniqueId: "MyUniqueID",
|
uniqueId: "MyUniqueID",
|
||||||
delay: 1000
|
delay: 1000,
|
||||||
},
|
},
|
||||||
blockStyles: {
|
blockStyles: {
|
||||||
bold: "__",
|
bold: "__",
|
||||||
italic: "_"
|
italic: "_",
|
||||||
},
|
},
|
||||||
element: document.getElementById("MyID"),
|
element: document.getElementById("MyID"),
|
||||||
forceSync: true,
|
forceSync: true,
|
||||||
@ -190,14 +190,14 @@ var editor = new EasyMDE({
|
|||||||
horizontalRule: ["", "\n\n-----\n\n"],
|
horizontalRule: ["", "\n\n-----\n\n"],
|
||||||
image: [""],
|
image: [""],
|
||||||
link: ["[", "](http://)"],
|
link: ["[", "](http://)"],
|
||||||
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"]
|
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],
|
||||||
},
|
},
|
||||||
lineWrapping: false,
|
lineWrapping: false,
|
||||||
minHeight: "500px",
|
minHeight: "500px",
|
||||||
parsingConfig: {
|
parsingConfig: {
|
||||||
allowAtxHeaderWithoutSpace: true,
|
allowAtxHeaderWithoutSpace: true,
|
||||||
strikethrough: false,
|
strikethrough: false,
|
||||||
underscoresBreakWords: true
|
underscoresBreakWords: true,
|
||||||
},
|
},
|
||||||
placeholder: "Type here...",
|
placeholder: "Type here...",
|
||||||
previewRender: function(plainText) {
|
previewRender: function(plainText) {
|
||||||
@ -213,11 +213,11 @@ var editor = new EasyMDE({
|
|||||||
promptURLs: true,
|
promptURLs: true,
|
||||||
promptTexts: {
|
promptTexts: {
|
||||||
image: "Custom prompt for URL:",
|
image: "Custom prompt for URL:",
|
||||||
link: "Custom prompt for URL:"
|
link: "Custom prompt for URL:",
|
||||||
},
|
},
|
||||||
renderingConfig: {
|
renderingConfig: {
|
||||||
singleLineBreaks: false,
|
singleLineBreaks: false,
|
||||||
codeSyntaxHighlighting: true
|
codeSyntaxHighlighting: true,
|
||||||
},
|
},
|
||||||
shortcuts: {
|
shortcuts: {
|
||||||
drawTable: "Cmd-Alt-T"
|
drawTable: "Cmd-Alt-T"
|
||||||
@ -234,13 +234,13 @@ var editor = new EasyMDE({
|
|||||||
},
|
},
|
||||||
onUpdate: function(el) {
|
onUpdate: function(el) {
|
||||||
el.innerHTML = ++this.keystrokes + " Keystrokes";
|
el.innerHTML = ++this.keystrokes + " Keystrokes";
|
||||||
}
|
},
|
||||||
}], // Another optional usage, with a custom status bar item that counts keystrokes
|
}], // Another optional usage, with a custom status bar item that counts keystrokes
|
||||||
styleSelectedText: false,
|
styleSelectedText: false,
|
||||||
syncSideBySidePreviewScroll: false,
|
syncSideBySidePreviewScroll: false,
|
||||||
tabSize: 4,
|
tabSize: 4,
|
||||||
toolbar: false,
|
toolbar: false,
|
||||||
toolbarTips: false
|
toolbarTips: false,
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ var easyMDE = new EasyMDE({
|
|||||||
name: "bold",
|
name: "bold",
|
||||||
action: EasyMDE.toggleBold,
|
action: EasyMDE.toggleBold,
|
||||||
className: "fa fa-bold",
|
className: "fa fa-bold",
|
||||||
title: "Bold"
|
title: "Bold",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "custom",
|
name: "custom",
|
||||||
@ -305,7 +305,7 @@ var easyMDE = new EasyMDE({
|
|||||||
// Add your own code
|
// Add your own code
|
||||||
},
|
},
|
||||||
className: "fa fa-star",
|
className: "fa fa-star",
|
||||||
title: "Custom Button"
|
title: "Custom Button",
|
||||||
},
|
},
|
||||||
"|" // Separator
|
"|" // Separator
|
||||||
// [, ...]
|
// [, ...]
|
||||||
@ -342,7 +342,7 @@ var editor = new EasyMDE({
|
|||||||
shortcuts: {
|
shortcuts: {
|
||||||
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
|
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
|
||||||
"toggleCodeBlock": null, // unbind Ctrl-Alt-C
|
"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
|
"drawTable": "Cmd-Alt-T", // bind Cmd-Alt-T to drawTable action, which doesn't come with a default shortcut
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user