Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

textarea-markdown

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textarea-markdown - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

6

lib/textarea-markdown.js

@@ -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 @@ });

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc