Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1011)

Delta Between Two Patch Sets: Lib/html/entities.py

Issue 11113: html.entities mapping dicts need updating?
Left Patch Set: Created 6 years, 12 months ago
Right Patch Set: Created 6 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/html.entities.rst ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 """HTML character entity references.""" 1 """HTML character entity references."""
2 2
3 # maps the HTML entity name to the Unicode codepoint 3 # maps the HTML entity name to the Unicode codepoint
4 name2codepoint = { 4 name2codepoint = {
5 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U +00C6 ISOlat1 5 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U +00C6 ISOlat1
6 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 6 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
7 'Acirc': 0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1 7 'Acirc': 0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1
8 'Agrave': 0x00c0, # latin capital letter A with grave = latin capital lett er A grave, U+00C0 ISOlat1 8 'Agrave': 0x00c0, # latin capital letter A with grave = latin capital lett er A grave, U+00C0 ISOlat1
9 'Alpha': 0x0391, # greek capital letter alpha, U+0391 9 'Alpha': 0x0391, # greek capital letter alpha, U+0391
10 'Aring': 0x00c5, # latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 10 'Aring': 0x00c5, # latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 'yacute': 0x00fd, # latin small letter y with acute, U+00FD ISOlat1 251 'yacute': 0x00fd, # latin small letter y with acute, U+00FD ISOlat1
252 'yen': 0x00a5, # yen sign = yuan sign, U+00A5 ISOnum 252 'yen': 0x00a5, # yen sign = yuan sign, U+00A5 ISOnum
253 'yuml': 0x00ff, # latin small letter y with diaeresis, U+00FF ISOlat1 253 'yuml': 0x00ff, # latin small letter y with diaeresis, U+00FF ISOlat1
254 'zeta': 0x03b6, # greek small letter zeta, U+03B6 ISOgrk3 254 'zeta': 0x03b6, # greek small letter zeta, U+03B6 ISOgrk3
255 'zwj': 0x200d, # zero width joiner, U+200D NEW RFC 2070 255 'zwj': 0x200d, # zero width joiner, U+200D NEW RFC 2070
256 'zwnj': 0x200c, # zero width non-joiner, U+200C NEW RFC 2070 256 'zwnj': 0x200c, # zero width non-joiner, U+200C NEW RFC 2070
257 } 257 }
258 258
259 259
260 # maps the HTML5 named character references to the equivalent Unicode character( s) 260 # maps the HTML5 named character references to the equivalent Unicode character( s)
261 html5namedcharref = { 261 html5 = {
262 'Aacute;': '\xc1', 262 'Aacute;': '\xc1',
263 'Aacute': '\xc1', 263 'Aacute': '\xc1',
264 'aacute;': '\xe1', 264 'aacute;': '\xe1',
265 'aacute': '\xe1', 265 'aacute': '\xe1',
266 'Abreve;': '\u0102', 266 'Abreve;': '\u0102',
267 'abreve;': '\u0103', 267 'abreve;': '\u0103',
268 'ac;': '\u223e', 268 'ac;': '\u223e',
269 'acd;': '\u223f', 269 'acd;': '\u223f',
270 'acE;': '\u223e\u0333', 270 'acE;': '\u223e\u0333',
271 'Acirc;': '\xc2', 271 'Acirc;': '\xc2',
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 2497
2498 # maps the HTML entity name to the character 2498 # maps the HTML entity name to the character
2499 # (or a character reference if the character is outside the Latin-1 range) 2499 # (or a character reference if the character is outside the Latin-1 range)
2500 entitydefs = {} 2500 entitydefs = {}
2501 2501
2502 for (name, codepoint) in name2codepoint.items(): 2502 for (name, codepoint) in name2codepoint.items():
2503 codepoint2name[codepoint] = name 2503 codepoint2name[codepoint] = name
2504 entitydefs[name] = chr(codepoint) 2504 entitydefs[name] = chr(codepoint)
2505 2505
2506 del name, codepoint 2506 del name, codepoint
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+