externalLinks()
Fügt externen Links in Ihrer Markdown-Ausgabe die Attribute rel und target hinzu.
import { externalLinks } from "@unifast/node";Signatur
function externalLinks(options?: ExternalLinksPluginOptions): UnifastPluginParameter
options?
Konfiguration für die Attribute externer Links
| Eigenschaft | Typ | Standard | Beschreibung |
|---|---|---|---|
rel | string | "nofollow noopener noreferrer" | Wert für das rel-Attribut externer Links |
target | string | — | Wert für das target-Attribut (z. B. “_blank”) |
Verwendung
import { compile, externalLinks } from "@unifast/node";
const result = compile(md, {
plugins: [
externalLinks({
rel: "nofollow noopener noreferrer",
target: "_blank",
}),
],
});