mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-02 23:54:28 -06:00
Fix indenting and some leftover old JS
This commit is contained in:
parent
86e40bcf4a
commit
551c84bc01
23
README.md
23
README.md
@ -190,7 +190,7 @@ easyMDE.value('New input for **EasyMDE**');
|
|||||||
- **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.`.
|
- **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#.`.
|
- **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#.`.
|
- **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 `function(errorMessage) {alert(errorMessage);};`.
|
- **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).
|
- **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">`
|
- **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`.
|
- **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`.
|
||||||
@ -218,7 +218,7 @@ easyMDE.value('New input for **EasyMDE**');
|
|||||||
|
|
||||||
Most options demonstrate the non-default behavior:
|
Most options demonstrate the non-default behavior:
|
||||||
|
|
||||||
```JavaScript
|
```js
|
||||||
const editor = new EasyMDE({
|
const editor = new EasyMDE({
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
autosave: {
|
autosave: {
|
||||||
@ -352,7 +352,7 @@ Customize the toolbar using the `toolbar` option.
|
|||||||
|
|
||||||
Only the order of existing buttons:
|
Only the order of existing buttons:
|
||||||
|
|
||||||
```JavaScript
|
```js
|
||||||
const easyMDE = new EasyMDE({
|
const easyMDE = new EasyMDE({
|
||||||
toolbar: ["bold", "italic", "heading", "|", "quote"]
|
toolbar: ["bold", "italic", "heading", "|", "quote"]
|
||||||
});
|
});
|
||||||
@ -360,9 +360,10 @@ const easyMDE = new EasyMDE({
|
|||||||
|
|
||||||
All information and/or add your own icons
|
All information and/or add your own icons
|
||||||
|
|
||||||
```Javascript
|
```js
|
||||||
const easyMDE = new EasyMDE({
|
const easyMDE = new EasyMDE({
|
||||||
toolbar: [{
|
toolbar: [
|
||||||
|
{
|
||||||
name: "bold",
|
name: "bold",
|
||||||
action: EasyMDE.toggleBold,
|
action: EasyMDE.toggleBold,
|
||||||
className: "fa fa-bold",
|
className: "fa fa-bold",
|
||||||
@ -370,7 +371,7 @@ const easyMDE = new EasyMDE({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "custom",
|
name: "custom",
|
||||||
action: function customFunction(editor){
|
action: function customFunction(editor) {
|
||||||
// Add your own code
|
// Add your own code
|
||||||
},
|
},
|
||||||
className: "fa fa-star",
|
className: "fa fa-star",
|
||||||
@ -384,7 +385,7 @@ const easyMDE = new EasyMDE({
|
|||||||
|
|
||||||
Put some buttons on dropdown menu
|
Put some buttons on dropdown menu
|
||||||
|
|
||||||
```Javascript
|
```js
|
||||||
const easyMDE = new EasyMDE({
|
const easyMDE = new EasyMDE({
|
||||||
toolbar: [{
|
toolbar: [{
|
||||||
name: "heading",
|
name: "heading",
|
||||||
@ -446,7 +447,7 @@ Shortcut (Windows / Linux) | Shortcut (macOS) | Action
|
|||||||
|
|
||||||
Here is how you can change a few, while leaving others untouched:
|
Here is how you can change a few, while leaving others untouched:
|
||||||
|
|
||||||
```JavaScript
|
```js
|
||||||
const editor = new EasyMDE({
|
const editor = new EasyMDE({
|
||||||
shortcuts: {
|
shortcuts: {
|
||||||
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
|
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
|
||||||
@ -467,9 +468,9 @@ The list of actions that can be bound is the same as the list of built-in action
|
|||||||
|
|
||||||
You can catch the following list of events: https://codemirror.net/doc/manual.html#events
|
You can catch the following list of events: https://codemirror.net/doc/manual.html#events
|
||||||
|
|
||||||
```JavaScript
|
```js
|
||||||
const easyMDE = new EasyMDE();
|
const easyMDE = new EasyMDE();
|
||||||
easyMDE.codemirror.on("change", function(){
|
easyMDE.codemirror.on("change", () => {
|
||||||
console.log(easyMDE.value());
|
console.log(easyMDE.value());
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -479,7 +480,7 @@ easyMDE.codemirror.on("change", function(){
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
```JavaScript
|
```js
|
||||||
const easyMDE = new EasyMDE();
|
const easyMDE = new EasyMDE();
|
||||||
// ...
|
// ...
|
||||||
easyMDE.toTextArea();
|
easyMDE.toTextArea();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user