textarea-markdown
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -15,2 +15,6 @@ 'use strict'; | ||
var _markdownItPlantuml = require('markdown-it-plantuml'); | ||
var _markdownItPlantuml2 = _interopRequireDefault(_markdownItPlantuml); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -59,2 +63,3 @@ | ||
}); | ||
this.applyPreview(); | ||
} | ||
@@ -109,2 +114,3 @@ } | ||
}); | ||
md.use(_markdownItPlantuml2.default); | ||
preview.innerHTML = md.render(_this3.textarea.value); | ||
@@ -111,0 +117,0 @@ }); |
{ | ||
"name": "textarea-markdown", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Make textarea a markdown editor.", | ||
@@ -5,0 +5,0 @@ "main": "lib/textarea-markdown.js", |
@@ -28,1 +28,24 @@ # textarea-markdown | ||
with rails. | ||
```html | ||
<textarea id="editor" data-preview="#preview"></textarea> | ||
<div id="preview"></div> | ||
``` | ||
```javascript | ||
import TextareaMarkdown from 'textarea-markdown' | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const token = document.querySelector("meta[name=\"csrf-token\"]").content; | ||
const textarea = document.querySelector('#editor'); | ||
new TextareaMarkdown(textarea, { | ||
endPoint: '/api/image.json', | ||
paramName: 'file', | ||
responseKey: 'url', | ||
csrfToken: token, | ||
placeholder: 'uploading %filename ...' | ||
}) | ||
}); | ||
``` |
@@ -26,2 +26,3 @@ import 'whatwg-fetch' | ||
Array.from(document.querySelectorAll(selector), e => this.previews.push(e)) | ||
this.applyPreview(); | ||
} | ||
@@ -28,0 +29,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
15260
356
51