CommonMark Compliance

The ToHtml API uses CommonMark 0.31.2 as its reference for converting Markdown to HTML. Because NTokenizers is built on a streaming architecture — it processes input character-by-character and emits output incrementally as it arrives — full byte-for-byte conformance with the CommonMark reference implementation is not possible in a number of cases.

This page lists all documented differences. The intended output is defined by the NTokenizers.Tests.ToHtml test suite; every intentional difference is annotated with a // Deviation: comment next to the corresponding assertion.

Design-level deviations

These properties apply to the NTokenizers library as a whole, not only to the ToHtml output:

ToHtml output deviations

Rendering

Content fidelity

The tokenizer preserves content exactly as it appears in the input:

Raw HTML

Entity and character references

Blockquotes

Lists

Unsupported CommonMark features

The following CommonMark features are intentionally not supported due to the streaming architecture:

Conformance status

As of this release, 176 of the 652 CommonMark 0.31.2 spec examples produce byte-identical output through MarkdownConverter.ToHtml().

The repository contains a read-only conformance monitor, tests/NTokenizers.Tests.ToHtml.CommonMark.Compliance, that tracks how far the converter is from full conformance. Failing tests there are expected until the corresponding feature is implemented; the suite must never be modified, only the converter.

See Also

"