deno-markup-tag
Usage
tag
// common usage
assertEquals(
tag("div", { id: "foo", class: "bar" }, "Hello world!"),
`<div id="foo" class="bar">Hello world!</div>`,
);
// void (no-close) tag
assertEquals(tag("meta", { charset: "utf-8" }), `<meta charset="utf-8">`);
// nested tags
assertEquals(
tag("ul", { class: "nav" }, tag("li", "first"), tag("li", "second")),
`<ul class="nav"><li>first</li><li>second</li></ul>`,
);
Character references
These constants are exported.
const NBSP = " ";
const LT = "<";
const GT = ">";
const AMP = "&";
const QUOT = """;