From 4b3930c4a7d3894a962feb5448bb017c09ea524a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 17 May 2022 00:26:02 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 50 ++++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index a582784..aed5739 100644 --- a/README.md +++ b/README.md @@ -71,16 +71,16 @@ Or *jsDelivr*: ### Loading the editor -After installing and/or importing the module, you can load EasyMDE onto the first TextArea on the web page: +After installing and/or importing the module, you can load EasyMDE onto the first `textarea` element on the web page: -```html +```html` ``` -Alternatively you can select a specific TextArea, via Javascript: +Alternatively you can select a specific `textarea`, via JavaScript: ```html @@ -89,19 +89,9 @@ const easyMDE = new EasyMDE({element: document.getElementById('my-text-area')}); ``` -Or via jQuery: - -```html - - -``` - - ### Editor functions -Use EasyMDE.value() to get the content of the editor: +Use `easyMDE.value()` to get the content of the editor: ```html ``` -Use EasyMDE.value(val) to set the content of the editor: +Use `easyMDE.value(val)` to set the content of the editor: ```html `
`` - **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`. - **markedOptions**: Set the internal Markdown renderer's [options](https://marked.js.org/#/USING_ADVANCED.md#options). Other `renderingConfig` options will take precedence. - - **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`. - - **sanitizerFunction**: Custom function for sanitizing the HTML output of markdown renderer. + - **singleLineBreaks**: If set to `false`, disable parsing [GitHub Flavored Markdown](https://github.github.com/gfm/) (GFM) single line breaks. Defaults to `true`. + - **sanitizerFunction**: Custom function for sanitizing the HTML output of Markdown renderer. - **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts). - **showIcons**: An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar. - **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`. Optionally pass a CodeMirrorSpellChecker-compliant function. @@ -321,7 +311,7 @@ const editor = new EasyMDE({ ### Toolbar icons -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. Note that shortcut hints are added automatically and reflect the specified action if it has a key bind assigned to it (i.e. with the value of `action` set to `bold` and that of `tooltip` set to `Bold`, the final text the user will see would be "Bold (Ctrl-B)"). +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 JavaScript. "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. Note that shortcut hints are added automatically and reflect the specified action if it has a key bind assigned to it (i.e. with the value of `action` set to `bold` and that of `tooltip` set to `Bold`, the final text the user will see would be "Bold (Ctrl-B)"). Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array. @@ -499,7 +489,7 @@ easyMDE.toTextArea(); easyMDE = null; ``` -If you need to remove installed listeners (when editor not needed anymore), call `easyMDE.cleanup()` +If you need to remove registered event listeners (when the editor is not needed anymore), call `easyMDE.cleanup()`. ### Useful methods @@ -521,7 +511,7 @@ EasyMDE is a continuation of SimpleMDE. SimpleMDE began as an improvement of [lepture's Editor project](https://github.com/lepture/editor), but has now taken on an identity of its own. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fontawesome.io). -CodeMirror is the backbone of the project and parses much of the Markdown syntax as it's being written. This allows us to add styles to the Markdown that's being written. Additionally, a toolbar and status bar have been added to the top and bottom, respectively. Previews are rendered by [Marked](https://github.com/chjj/marked) using GFM. +CodeMirror is the backbone of the project and parses much of the Markdown syntax as it's being written. This allows us to add styles to the Markdown that's being written. Additionally, a toolbar and status bar have been added to the top and bottom, respectively. Previews are rendered by [Marked](https://github.com/chjj/marked) using GitHub Flavored Markdown (GFM). ## SimpleMDE fork @@ -536,7 +526,7 @@ Changes include: * Support for Node 8 and beyond * Lots of refactored code * Links in preview will open in a new tab by default -* Typescript support +* TypeScript support My intention is to continue development on this project, improving it and keeping it alive. From a433f7289135f98dbc344620f0fcead5cb467576 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 17 May 2022 11:12:46 +0200 Subject: [PATCH 2/2] Update README.md Co-authored-by: Jeroen Akkerman --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aed5739..e50c377 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Or *jsDelivr*: After installing and/or importing the module, you can load EasyMDE onto the first `textarea` element on the web page: -```html` +```html