nizel-plugin-autolink
v0.1.1
Published
Autolink behavior plugin for Nizel.
Downloads
249
Readme
nizel-plugin-autolink
Autolink behavior plugin for Nizel.
Configures how bare URLs and email addresses are converted to links.
Install
npm install nizel-plugin-autolinkUsage
import { useNizel } from 'nizel';
import { autolinkPlugin } from 'nizel-plugin-autolink';
const processor = useNizel({
plugins: [
autolinkPlugin({
enabled: true,
target: '_blank',
rel: 'noopener noreferrer',
}),
],
});
const result = processor.process('Visit https://example.com');
// <p>Visit <a href="https://example.com" target="_blank" rel="noopener noreferrer">https://example.com</a></p>Options
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| enabled | boolean | true | Enable or disable autolinking |
| target | string | — | target attribute for generated links |
| rel | string | — | rel attribute for generated links |
License
MIT
