UNPKG

@tabnews/ui

Version:
15 lines (14 loc) 426 B
import u from "rehype-external-links"; function s({ shouldAddNofollow: o = () => !0, options: i = {} } = {}) { function p(r) { var t; const e = [], n = (t = r.properties) == null ? void 0 : t.href; return n && (o(n) && e.push("nofollow"), r.properties.target === "_blank" && e.push("noopener")), e; } return { rehype: (r) => r.use(() => u({ rel: p, ...i })) }; } export { s as externalLinksPlugin };