Skip to content

image()

ts
function image(source, alt?): Node;

Defined in: image.ts:27

Builder-element for an image

Parameters

ParameterTypeDescription
sourcestring | NodeSource of the image
alt?string | NodeAlt-text of the image

Returns

Node

A markdown node

Example

ts
import { define, image } from "@ogs-gmbh/markdown";

const markdown = define(
  image("https://example.com/image.png", "An example image")
);

console.assert(
  markdown.toString()
);

See

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images

Since

1.0.0

Author

Simon Kovtyk