textarea-markdown
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -11,5 +11,5 @@ 'use strict'; | ||
var _marked = require('marked'); | ||
var _markdownIt = require('markdown-it'); | ||
var _marked2 = _interopRequireDefault(_marked); | ||
var _markdownIt2 = _interopRequireDefault(_markdownIt); | ||
@@ -102,3 +102,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
this.previews.forEach(function (preview) { | ||
preview.innerHTML = (0, _marked2.default)(_this3.textarea.value, { breaks: true }); | ||
var md = new _markdownIt2.default({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: true, | ||
linkify: true | ||
}); | ||
preview.innerHTML = md.render(_this3.textarea.value); | ||
}); | ||
@@ -105,0 +111,0 @@ } |
{ | ||
"name": "textarea-markdown", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Make textarea a markdown editor.", | ||
@@ -18,3 +18,3 @@ "main": "lib/textarea-markdown.js", | ||
"dependencies": { | ||
"marked": "^0.3.6", | ||
"markdown-it": "^8.4.0", | ||
"whatwg-fetch": "^2.0.3" | ||
@@ -21,0 +21,0 @@ }, |
import 'whatwg-fetch' | ||
import marked from 'marked' | ||
import MarkdownIt from 'markdown-it' | ||
@@ -61,3 +61,9 @@ export default class TextareaMarkdown { | ||
this.previews.forEach((preview) => { | ||
preview.innerHTML = marked(this.textarea.value, { breaks: true }); | ||
let md = new MarkdownIt({ | ||
html: true, | ||
breaks: true, | ||
langPrefix: true, | ||
linkify: true | ||
}); | ||
preview.innerHTML = md.render(this.textarea.value); | ||
}) | ||
@@ -64,0 +70,0 @@ } |
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
14343
349
9
+ Addedmarkdown-it@^8.4.0
+ Addedargparse@1.0.10(transitive)
+ Addedentities@1.1.2(transitive)
+ Addedlinkify-it@2.2.0(transitive)
+ Addedmarkdown-it@8.4.2(transitive)
+ Addedmdurl@1.0.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addeduc.micro@1.0.6(transitive)
- Removedmarked@^0.3.6
- Removedmarked@0.3.19(transitive)