Fix indenting and some leftover old JS

pull/363/head
Jeroen Akkerman 3 years ago
parent 86e40bcf4a
commit 551c84bc01

@ -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.`.
- **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 `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).
- **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`.
@ -218,7 +218,7 @@ easyMDE.value('New input for **EasyMDE**');
Most options demonstrate the non-default behavior:
```JavaScript
```js
const editor = new EasyMDE({
autofocus: true,
autosave: {
@ -352,7 +352,7 @@ Customize the toolbar using the `toolbar` option.
Only the order of existing buttons:
```JavaScript
```js
const easyMDE = new EasyMDE({
toolbar: ["bold", "italic", "heading", "|", "quote"]
});
@ -360,9 +360,10 @@ const easyMDE = new EasyMDE({
All information and/or add your own icons
```Javascript
```js
const easyMDE = new EasyMDE({
toolbar: [{
toolbar: [
{
name: "bold",
action: EasyMDE.toggleBold,
className: "fa fa-bold",
@ -384,7 +385,7 @@ const easyMDE = new EasyMDE({
Put some buttons on dropdown menu
```Javascript
```js
const easyMDE = new EasyMDE({
toolbar: [{
name: "heading",
@ -446,7 +447,7 @@ Shortcut (Windows / Linux) | Shortcut (macOS) | Action
Here is how you can change a few, while leaving others untouched:
```JavaScript
```js
const editor = new EasyMDE({
shortcuts: {
"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
```JavaScript
```js
const easyMDE = new EasyMDE();
easyMDE.codemirror.on("change", function(){
easyMDE.codemirror.on("change", () => {
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.
```JavaScript
```js
const easyMDE = new EasyMDE();
// ...
easyMDE.toTextArea();

Loading…
Cancel
Save