mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-19 07:54:28 -06:00
Merge pull request #366 from kongregate/configure-marked
Allow user to configure marked options
This commit is contained in:
commit
f2d1af5dee
@ -96,6 +96,7 @@ simplemde.value("This text will appear in the editor");
|
|||||||
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
|
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
|
||||||
- **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`.
|
- **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`.
|
||||||
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
|
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
|
||||||
|
- **markedOptions**: Set default marked markdown renderer default [options](https://github.com/chjj/marked#options-1). `singleLineBreaks` and `codeSyntaxHighlighting` options below will take precedence.
|
||||||
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
||||||
- **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. 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. 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">`
|
||||||
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
|
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
|
||||||
|
@ -1392,8 +1392,12 @@ function SimpleMDE(options) {
|
|||||||
SimpleMDE.prototype.markdown = function(text) {
|
SimpleMDE.prototype.markdown = function(text) {
|
||||||
if(marked) {
|
if(marked) {
|
||||||
// Initialize
|
// Initialize
|
||||||
var markedOptions = {};
|
var markedOptions;
|
||||||
|
if(this.options && this.options.renderingConfig && this.options.renderingConfig.markedOptions) {
|
||||||
|
markedOptions = this.options.renderingConfig.markedOptions;
|
||||||
|
} else {
|
||||||
|
markedOptions = {};
|
||||||
|
}
|
||||||
|
|
||||||
// Update options
|
// Update options
|
||||||
if(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {
|
if(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user