Files
Liber-public/crates/liber-format/src/entities.rs
T

169 lines
4.2 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! The named entities an XHTML book may use without declaring them: the five XML ones and HTML 4's (Latin-1,
//! symbols, specials). Nothing is ever resolved from a DOCTYPE.
pub fn resolve(name: &str) -> Option<&'static str> {
Some(match name {
"amp" => "&",
"lt" => "<",
"gt" => ">",
"quot" => "\"",
"apos" => "'",
"nbsp" => "\u{a0}",
"iexcl" => "¡",
"cent" => "¢",
"pound" => "£",
"curren" => "¤",
"yen" => "¥",
"brvbar" => "¦",
"sect" => "§",
"uml" => "¨",
"copy" => "©",
"ordf" => "ª",
"laquo" => "«",
"not" => "¬",
"shy" => "\u{ad}",
"reg" => "®",
"macr" => "¯",
"deg" => "°",
"plusmn" => "±",
"sup2" => "²",
"sup3" => "³",
"acute" => "´",
"micro" => "µ",
"para" => "",
"middot" => "·",
"cedil" => "¸",
"sup1" => "¹",
"ordm" => "º",
"raquo" => "»",
"frac14" => "¼",
"frac12" => "½",
"frac34" => "¾",
"iquest" => "¿",
"Agrave" => "À",
"Aacute" => "Á",
"Acirc" => "Â",
"Atilde" => "Ã",
"Auml" => "Ä",
"Aring" => "Å",
"AElig" => "Æ",
"Ccedil" => "Ç",
"Egrave" => "È",
"Eacute" => "É",
"Ecirc" => "Ê",
"Euml" => "Ë",
"Igrave" => "Ì",
"Iacute" => "Í",
"Icirc" => "Î",
"Iuml" => "Ï",
"ETH" => "Ð",
"Ntilde" => "Ñ",
"Ograve" => "Ò",
"Oacute" => "Ó",
"Ocirc" => "Ô",
"Otilde" => "Õ",
"Ouml" => "Ö",
"times" => "×",
"Oslash" => "Ø",
"Ugrave" => "Ù",
"Uacute" => "Ú",
"Ucirc" => "Û",
"Uuml" => "Ü",
"Yacute" => "Ý",
"THORN" => "Þ",
"szlig" => "ß",
"agrave" => "à",
"aacute" => "á",
"acirc" => "â",
"atilde" => "ã",
"auml" => "ä",
"aring" => "å",
"aelig" => "æ",
"ccedil" => "ç",
"egrave" => "è",
"eacute" => "é",
"ecirc" => "ê",
"euml" => "ë",
"igrave" => "ì",
"iacute" => "í",
"icirc" => "î",
"iuml" => "ï",
"eth" => "ð",
"ntilde" => "ñ",
"ograve" => "ò",
"oacute" => "ó",
"ocirc" => "ô",
"otilde" => "õ",
"ouml" => "ö",
"divide" => "÷",
"oslash" => "ø",
"ugrave" => "ù",
"uacute" => "ú",
"ucirc" => "û",
"uuml" => "ü",
"yacute" => "ý",
"thorn" => "þ",
"yuml" => "ÿ",
"OElig" => "Œ",
"oelig" => "œ",
"Scaron" => "Š",
"scaron" => "š",
"Yuml" => "Ÿ",
"fnof" => "ƒ",
"circ" => "ˆ",
"tilde" => "˜",
"ensp" => "\u{2002}",
"emsp" => "\u{2003}",
"thinsp" => "\u{2009}",
"zwnj" => "\u{200c}",
"zwj" => "\u{200d}",
"lrm" => "\u{200e}",
"rlm" => "\u{200f}",
"ndash" => "–",
"mdash" => "—",
"lsquo" => "‘",
"rsquo" => "’",
"sbquo" => "‚",
"ldquo" => "“",
"rdquo" => "”",
"bdquo" => "„",
"dagger" => "†",
"Dagger" => "‡",
"bull" => "•",
"hellip" => "…",
"permil" => "‰",
"prime" => "′",
"Prime" => "″",
"lsaquo" => "‹",
"rsaquo" => "›",
"oline" => "‾",
"frasl" => "⁄",
"euro" => "€",
"trade" => "™",
"larr" => "←",
"uarr" => "↑",
"rarr" => "→",
"darr" => "↓",
"harr" => "↔",
"minus" => "−",
"infin" => "∞",
"ne" => "≠",
"le" => "≤",
"ge" => "≥",
"loz" => "◊",
"spades" => "♠",
"clubs" => "♣",
"hearts" => "♥",
"diams" => "♦",
"alpha" => "α",
"beta" => "β",
"gamma" => "γ",
"delta" => "δ",
"pi" => "π",
"sigma" => "σ",
"omega" => "ω",
"Omega" => "Ω",
_ => return None,
})
}