rehype-input-disable
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

rehype-input-disable

A rehype plugin to disable or enable specific input elements.

Install

npm install rehype-input-disable

Options

Optional:

  • type: filer by input type, e.g. "checkbox"
  • disabled: set the property to either true or false. Defaults to true.

Usage

import { rehype } from "rehype";
import rehypeInputDisable from "rehypeInputDisable";

rehype()
  .use(rehypeInputDisable, { type: "checkbox" disabled: False })
  .process('<input type="checkbox" id="key" value="1" disabled>', function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Expected output:

<html>
  <head></head>
  <body>
    <input type="checkbox" id="key" value="1" />
  </body>
</html>

Package Sidebar

Install

npm i rehype-input-disable

Weekly Downloads

47

Version

1.0.0

License

MIT

Unpacked Size

4.19 kB

Total Files

5

Last publish

Collaborators

  • alphajack