remark-text-input

0.7.1 • Public • Published

remark-text-input

A remark plugin that parse Mardown syntax to add support for text area.

Syntax

You can add a text area this way :

[______
Some text.
_____]

Wich leads to :

Screenshot

Installation

Easy as npm i :

npm install remark-text-input

Installation

An example of code :

const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
 
const textInput = require('remark-text-input')
 
const testFile = `This is a text area : 
 
[_____
A editable text here
_____]`
 
unified()
  .use(remarkParse)
  .use(textInput)
  .use(remark2rehype) 
  .use(stringify)
  .process( testFile, (err, file) => {
    console.log(String(file));
  } );

In the file, a text-area should be preceded by an empty line.

Configuration

This plugin support custom HTML attributes :

[____
Here
some
text
_____]{.row=5 .cols=10}

Licence

MIT

Package Sidebar

Install

npm i remark-text-input

Weekly Downloads

6

Version

0.7.1

License

MIT

Unpacked Size

19.4 kB

Total Files

12

Last publish

Collaborators

  • ache