Link

import { Link } from "jsr:@ende/markdown";

interface

interface Link

A link. Inline links, autolinks, and reference links all become this node; a reference link carries the URL and title of its definition.

Example: Usage

import type { Link } from "@ende/markdown/types";
import { assertEquals } from "@ende/assert";

const node: Link = {
  type: "link",
  url: "https://ende.sh",
  title: null,
  children: [{ type: "text", value: "Ende" }]
};
assertEquals(node.url, "https://ende.sh");

Properties

type

type: "link"

Node type.

url

url: string

The destination, percent-encoded where needed.

title

title: string | null

The title, or null if there is none.

children

children: PhrasingContent[]

The link text.

Source