externalLinks()
Add rel and target attributes to external links in your Markdown output.
import { externalLinks } from "@unifast/node";Signature
function externalLinks(options?: ExternalLinksPluginOptions): UnifastPluginParameters
options?
Configuration for external link attributes
| Property | Type | Default | Description |
|---|---|---|---|
rel | string | "nofollow noopener noreferrer" | Value for the rel attribute on external links |
target | string | — | Value for the target attribute (e.g., “_blank”) |
Usage
import { compile, externalLinks } from "@unifast/node";
const result = compile(md, {
plugins: [
externalLinks({
rel: "nofollow noopener noreferrer",
target: "_blank",
}),
],
});