Code

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

interface

interface Code

A fenced or indented code block.

Example: Usage

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

const node: Code = { type: "code", lang: "ts", meta: null, value: "const x = 1;" };
assertEquals(node.lang, "ts");

Properties

type

type: "code"

Node type.

lang

lang: string | null

The first word of the info string, or null if there is none.

meta

meta: string | null

The rest of the info string after the first word, or null if there is none.

value

value: string

The code, without the final line ending.

Source