rehype-input-disable
v1.0.0
Published
rehype plugin plugin to disable or enable specific input elements
Downloads
11
Maintainers
Readme
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 eithertrue
orfalse
. Defaults totrue
.
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>