MD099 - Prefer literal Unicode characters to character references¶
Aliases: literal-unicode
This rule is opt-in and supports Standard, CommonMark, and GFM Markdown.
What this rule does¶
Reports character references in prose that decode to a visible, non-ASCII Unicode character. Literal characters are easier to read in Markdown source.
Examples¶
Incorrect¶
Correct¶
ASCII syntax characters, whitespace, invisible characters, combining marks, multi-character references, and invalid references are left as written.
The rule skips code, math, front matter, HTML blocks and tags, links, potential reference labels, footnotes and URLs. Other Markdown flavors are not checked.
Configuration¶
[global]
extend-enable = ["MD099"]
[MD099]
numeric = true # Also report decimal and hexadecimal references
allow = ["©"] # Allow these exact references
Automatic fixes¶
A fix is offered only for a reference separated from neighboring text by whitespace or the document boundary, and only when the complete replacement batch preserves the parsed rendering under both CommonMark and rumdl's parser. Other findings require manual editing.
An entity next to an emphasis delimiter is not necessarily safe to decode:
*é*x and *é*x render differently.
Related rules¶
- MD084 checks for invisible characters.