textarea-markdown
Advanced tools
Comparing version 1.2.9 to 1.2.10
@@ -34,3 +34,9 @@ 'use strict'; | ||
placeholder: 'uploading %filename ...', | ||
plugins: [] | ||
plugins: [], | ||
markdownOptions: Object.assign({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: 'language-', | ||
linkify: true | ||
}) | ||
}, options); | ||
@@ -102,12 +108,7 @@ this.previews = []; | ||
var markdownOptions = this.options['markdownOptions']; | ||
var plugins = this.options['plugins']; | ||
if (this.previews) { | ||
this.previews.forEach(function (preview) { | ||
var md = new _markdownIt2.default({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: 'language-', | ||
linkify: true | ||
}); | ||
var md = new _markdownIt2.default(markdownOptions); | ||
plugins.forEach(function (plugin) { | ||
@@ -114,0 +115,0 @@ return md.use(plugin); |
{ | ||
"name": "textarea-markdown", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Make textarea a markdown editor.", | ||
@@ -5,0 +5,0 @@ "main": "lib/textarea-markdown.js", |
@@ -13,3 +13,9 @@ import 'whatwg-fetch' | ||
placeholder: 'uploading %filename ...', | ||
plugins: [] | ||
plugins: [], | ||
markdownOptions: Object.assign({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: 'language-', | ||
linkify: true | ||
}) | ||
}, options) | ||
@@ -62,12 +68,7 @@ this.previews = []; | ||
applyPreview() { | ||
const markdownOptions = this.options['markdownOptions'] | ||
const plugins = this.options['plugins'] | ||
if (this.previews) { | ||
this.previews.forEach((preview) => { | ||
let md = new MarkdownIt({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: 'language-', | ||
linkify: true | ||
}); | ||
let md = new MarkdownIt(markdownOptions); | ||
plugins.forEach((plugin) => md.use(plugin)) | ||
@@ -74,0 +75,0 @@ preview.innerHTML = md.render(this.textarea.value); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19203
14
363