externalLinks()
Thêm thuộc tính rel và target vào các liên kết ngoài trong đầu ra Markdown của bạn.
import { externalLinks } from "@unifast/node";Chữ ký
function externalLinks(options?: ExternalLinksPluginOptions): UnifastPluginTham số
options?
Cấu hình cho các thuộc tính của liên kết ngoài
| Thuộc tính | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
rel | string | "nofollow noopener noreferrer" | Giá trị cho thuộc tính rel trên các liên kết ngoài |
target | string | — | Giá trị cho thuộc tính target (ví dụ “_blank”) |
Cách dùng
import { compile, externalLinks } from "@unifast/node";
const result = compile(md, {
plugins: [
externalLinks({
rel: "nofollow noopener noreferrer",
target: "_blank",
}),
],
});