From fdcd613199fe9a61607f8b0dd02ffa464e1ef6c4 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Tue, 3 Nov 2015 11:28:06 -0600 Subject: [PATCH] Document new option --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a5801a..88d8b4c 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,14 @@ simplemde.value("This text will appear in the editor"); - **hideIcons**: An array of icon names to hide. Can be used to hide specific icons without completely customizing the toolbar. - **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`. - **initialValue**: If set, will customize the initial value of the editor. +- **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://)"]`. + - horizontalRule + - image + - link - **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing). - - **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`. - - **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`. + - **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`. + - **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`. - **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`. - **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews. - **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing). @@ -105,6 +109,11 @@ var simplemde = new SimpleMDE({ hideIcons: ["guide", "heading"], indentWithTabs: false, initialValue: "Hello world!", + insertTexts: { + horizontalRule: ["", "\n\n-----\n\n"], + image: ["![](http://", ")"], + link: ["[", "](http://)"], + }, lineWrapping: false, parsingConfig: { allowAtxHeaderWithoutSpace: true,