Expand description
Language normalization and metadata for code blocks. Code fence language normalization.
This module exists so both the editor and viewer can share:
- a small, curated list of common language aliases
- consistent display labels (e.g.
rs->Rust)
The core renderer also uses this to populate data-language on <pre>
so CSS themes can show a proper label instead of a generic “Code”.
Structs§
- Code
Language - Canonical code-language name plus accepted aliases.
Constants§
- KNOWN_
CODE_ LANGUAGES - A small, human-curated set of common languages and their aliases.
Functions§
- canonical_
language_ name - If
rawis a known language (by canonical name or alias), return its canonical name. - language_
display_ label - Returns a display label for a fenced code language.