aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/constant.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 11:43:26 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 11:43:26 +0200
commitb75d7976cfe8db43783b930c1f4774f2ad4936f5 (patch)
treed8c38c5bc6d1427b408d0b6b53aeb33f39e8d704 /src/util/constant.rs
parentc12c31e1b2d55fa407217c0e14c51c8693f919ae (diff)
downloadmarkdown-rs-b75d7976cfe8db43783b930c1f4774f2ad4936f5.tar.gz
markdown-rs-b75d7976cfe8db43783b930c1f4774f2ad4936f5.tar.bz2
markdown-rs-b75d7976cfe8db43783b930c1f4774f2ad4936f5.zip
Add support for HTML 4 character references in JSX attributes
Diffstat (limited to 'src/util/constant.rs')
-rw-r--r--src/util/constant.rs268
1 files changed, 268 insertions, 0 deletions
diff --git a/src/util/constant.rs b/src/util/constant.rs
index e9deac2..65704d0 100644
--- a/src/util/constant.rs
+++ b/src/util/constant.rs
@@ -2433,6 +2433,274 @@ pub const CHARACTER_REFERENCES: [(&str, &str); 2125] = [
("zwnj", "‌"),
];
+// Important: please touch the below lists as few times as possible to keep Git small.
+
+/// List of names and values that form named character reference in HTML 4.
+///
+/// This list is normally not used in markdown, but it is used in MDX, because
+/// in JSX attribute values, only the old HTML 4 character references are
+/// supported.
+///
+/// This list is sensitive to casing.
+///
+/// ## References
+///
+/// * [*§ 1.5.2 HTML Character References* in `JSX`](https://facebook.github.io/jsx/#sec-HTMLCharacterReference)
+pub const CHARACTER_REFERENCES_HTML_4: [(&str, &str); 252] = [
+ ("AElig", "Æ"),
+ ("Aacute", "Á"),
+ ("Acirc", "Â"),
+ ("Agrave", "À"),
+ ("Alpha", "Α"),
+ ("Aring", "Å"),
+ ("Atilde", "Ã"),
+ ("Auml", "Ä"),
+ ("Beta", "Β"),
+ ("Ccedil", "Ç"),
+ ("Chi", "Χ"),
+ ("Dagger", "‡"),
+ ("Delta", "Δ"),
+ ("ETH", "Ð"),
+ ("Eacute", "É"),
+ ("Ecirc", "Ê"),
+ ("Egrave", "È"),
+ ("Epsilon", "Ε"),
+ ("Eta", "Η"),
+ ("Euml", "Ë"),
+ ("Gamma", "Γ"),
+ ("Iacute", "Í"),
+ ("Icirc", "Î"),
+ ("Igrave", "Ì"),
+ ("Iota", "Ι"),
+ ("Iuml", "Ï"),
+ ("Kappa", "Κ"),
+ ("Lambda", "Λ"),
+ ("Mu", "Μ"),
+ ("Ntilde", "Ñ"),
+ ("Nu", "Ν"),
+ ("OElig", "Œ"),
+ ("Oacute", "Ó"),
+ ("Ocirc", "Ô"),
+ ("Ograve", "Ò"),
+ ("Omega", "Ω"),
+ ("Omicron", "Ο"),
+ ("Oslash", "Ø"),
+ ("Otilde", "Õ"),
+ ("Ouml", "Ö"),
+ ("Phi", "Φ"),
+ ("Pi", "Π"),
+ ("Prime", "″"),
+ ("Psi", "Ψ"),
+ ("Rho", "Ρ"),
+ ("Scaron", "Š"),
+ ("Sigma", "Σ"),
+ ("THORN", "Þ"),
+ ("Tau", "Τ"),
+ ("Theta", "Θ"),
+ ("Uacute", "Ú"),
+ ("Ucirc", "Û"),
+ ("Ugrave", "Ù"),
+ ("Upsilon", "Υ"),
+ ("Uuml", "Ü"),
+ ("Xi", "Ξ"),
+ ("Yacute", "Ý"),
+ ("Yuml", "Ÿ"),
+ ("Zeta", "Ζ"),
+ ("aacute", "á"),
+ ("acirc", "â"),
+ ("acute", "´"),
+ ("aelig", "æ"),
+ ("agrave", "à"),
+ ("alefsym", "ℵ"),
+ ("alpha", "α"),
+ ("amp", "&"),
+ ("and", "∧"),
+ ("ang", "∠"),
+ ("aring", "å"),
+ ("asymp", "≈"),
+ ("atilde", "ã"),
+ ("auml", "ä"),
+ ("bdquo", "„"),
+ ("beta", "β"),
+ ("brvbar", "¦"),
+ ("bull", "•"),
+ ("cap", "∩"),
+ ("ccedil", "ç"),
+ ("cedil", "¸"),
+ ("cent", "¢"),
+ ("chi", "χ"),
+ ("circ", "ˆ"),
+ ("clubs", "♣"),
+ ("cong", "≅"),
+ ("copy", "©"),
+ ("crarr", "↵"),
+ ("cup", "∪"),
+ ("curren", "¤"),
+ ("dArr", "⇓"),
+ ("dagger", "†"),
+ ("darr", "↓"),
+ ("deg", "°"),
+ ("delta", "δ"),
+ ("diams", "♦"),
+ ("divide", "÷"),
+ ("eacute", "é"),
+ ("ecirc", "ê"),
+ ("egrave", "è"),
+ ("empty", "∅"),
+ ("emsp", " "),
+ ("ensp", " "),
+ ("epsilon", "ε"),
+ ("equiv", "≡"),
+ ("eta", "η"),
+ ("eth", "ð"),
+ ("euml", "ë"),
+ ("euro", "€"),
+ ("exist", "∃"),
+ ("fnof", "ƒ"),
+ ("forall", "∀"),
+ ("frac12", "½"),
+ ("frac14", "¼"),
+ ("frac34", "¾"),
+ ("frasl", "⁄"),
+ ("gamma", "γ"),
+ ("ge", "≥"),
+ ("gt", ">"),
+ ("hArr", "⇔"),
+ ("harr", "↔"),
+ ("hearts", "♥"),
+ ("hellip", "…"),
+ ("iacute", "í"),
+ ("icirc", "î"),
+ ("iexcl", "¡"),
+ ("igrave", "ì"),
+ ("image", "ℑ"),
+ ("infin", "∞"),
+ ("int", "∫"),
+ ("iota", "ι"),
+ ("iquest", "¿"),
+ ("isin", "∈"),
+ ("iuml", "ï"),
+ ("kappa", "κ"),
+ ("lArr", "⇐"),
+ ("lambda", "λ"),
+ ("lang", "〈"),
+ ("laquo", "«"),
+ ("larr", "←"),
+ ("lceil", "⌈"),
+ ("ldquo", "“"),
+ ("le", "≤"),
+ ("lfloor", "⌊"),
+ ("lowast", "∗"),
+ ("loz", "◊"),
+ ("lrm", "‎"),
+ ("lsaquo", "‹"),
+ ("lsquo", "‘"),
+ ("lt", "<"),
+ ("macr", "¯"),
+ ("mdash", "—"),
+ ("micro", "µ"),
+ ("middot", "·"),
+ ("minus", "−"),
+ ("mu", "μ"),
+ ("nabla", "∇"),
+ ("nbsp", " "),
+ ("ndash", "–"),
+ ("ne", "≠"),
+ ("ni", "∋"),
+ ("not", "¬"),
+ ("notin", "∉"),
+ ("nsub", "⊄"),
+ ("ntilde", "ñ"),
+ ("nu", "ν"),
+ ("oacute", "ó"),
+ ("ocirc", "ô"),
+ ("oelig", "œ"),
+ ("ograve", "ò"),
+ ("oline", "‾"),
+ ("omega", "ω"),
+ ("omicron", "ο"),
+ ("oplus", "⊕"),
+ ("or", "∨"),
+ ("ordf", "ª"),
+ ("ordm", "º"),
+ ("oslash", "ø"),
+ ("otilde", "õ"),
+ ("otimes", "⊗"),
+ ("ouml", "ö"),
+ ("para", "¶"),
+ ("part", "∂"),
+ ("permil", "‰"),
+ ("perp", "⊥"),
+ ("phi", "φ"),
+ ("pi", "π"),
+ ("piv", "ϖ"),
+ ("plusmn", "±"),
+ ("pound", "£"),
+ ("prime", "′"),
+ ("prod", "∏"),
+ ("prop", "∝"),
+ ("psi", "ψ"),
+ ("quot", "\""),
+ ("rArr", "⇒"),
+ ("radic", "√"),
+ ("rang", "〉"),
+ ("raquo", "»"),
+ ("rarr", "→"),
+ ("rceil", "⌉"),
+ ("rdquo", "”"),
+ ("real", "ℜ"),
+ ("reg", "®"),
+ ("rfloor", "⌋"),
+ ("rho", "ρ"),
+ ("rlm", "‏"),
+ ("rsaquo", "›"),
+ ("rsquo", "’"),
+ ("sbquo", "‚"),
+ ("scaron", "š"),
+ ("sdot", "⋅"),
+ ("sect", "§"),
+ ("shy", "\u{AD}"),
+ ("sigma", "σ"),
+ ("sigmaf", "ς"),
+ ("sim", "∼"),
+ ("spades", "♠"),
+ ("sub", "⊂"),
+ ("sube", "⊆"),
+ ("sum", "∑"),
+ ("sup", "⊃"),
+ ("sup1", "¹"),
+ ("sup2", "²"),
+ ("sup3", "³"),
+ ("supe", "⊇"),
+ ("szlig", "ß"),
+ ("tau", "τ"),
+ ("there4", "∴"),
+ ("theta", "θ"),
+ ("thetasym", "ϑ"),
+ ("thinsp", " "),
+ ("thorn", "þ"),
+ ("tilde", "˜"),
+ ("times", "×"),
+ ("trade", "™"),
+ ("uArr", "⇑"),
+ ("uacute", "ú"),
+ ("uarr", "↑"),
+ ("ucirc", "û"),
+ ("ugrave", "ù"),
+ ("uml", "¨"),
+ ("upsih", "ϒ"),
+ ("upsilon", "υ"),
+ ("uuml", "ü"),
+ ("weierp", "℘"),
+ ("xi", "ξ"),
+ ("yacute", "ý"),
+ ("yen", "¥"),
+ ("yuml", "ÿ"),
+ ("zeta", "ζ"),
+ ("zwj", "‍"),
+ ("zwnj", "‌"),
+];
+
#[cfg(test)]
mod tests {
use super::*;