micromark HTML Tag Names Utility

2.0.1 · active · verified Sun Apr 19

micromark-util-html-tag-name is a low-level utility package within the `micromark` ecosystem, providing curated lists of HTML tag names relevant for CommonMark-compliant Markdown parsing. Specifically, it exports `htmlBlockNames` and `htmlRawNames`, which are used by `micromark` to apply specific parsing rules for HTML (flow) constructs. The `htmlBlockNames` array aids in determining when more relaxed parsing rules apply, based on CommonMark's condition 6, while `htmlRawNames` guides the parser on when HTML content can include lines without exiting until a matching closing tag is found (CommonMark's condition 1). This package is currently in its stable version 2.0.1 and is actively maintained as part of the `micromark` monorepo, which generally sees frequent updates, often with performance enhancements, and drops support for unmaintained Node.js versions with new major releases. It's designed for developers building or extending `micromark` itself, rather than for general HTML tag lookup.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and access the `htmlBlockNames` and `htmlRawNames` arrays, detailing their purpose within the micromark parser's logic for handling HTML tags based on CommonMark specifications.

import { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';

console.log('--- HTML Block Names (CommonMark Condition 6) ---');
console.log('These tags allow more relaxed parsing rules within micromark.');
console.log('Examples:', htmlBlockNames.slice(0, 5).join(', ') + '...');
console.log(`Total block tags: ${htmlBlockNames.length}`);

console.log('\n--- HTML Raw Names (CommonMark Condition 1) ---');
console.log('Content within these tags is treated as raw HTML, without further Markdown parsing, until a closing tag is found.');
console.log('Examples:', htmlRawNames.slice(0, 3).join(', ') + '...');
console.log(`Total raw tags: ${htmlRawNames.length}`);

// This utility package primarily provides these lists for use within the micromark parser.
// It is not intended for general-purpose HTML tag validation or manipulation outside of micromark's context.
// Developers building custom micromark extensions or alternatives might directly consume these lists.

view raw JSON →