Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1898)

Side by Side Diff: pkg/third_party/html5lib/lib/src/inputstream.dart

Issue 157983005: pkg/third_party/html5lib: lots of cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: bump version Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library inputstream; 1 library inputstream;
2 2
3 import 'dart:collection'; 3 import 'dart:collection';
4 import 'package:utf/utf.dart'; 4 import 'package:utf/utf.dart';
5 import 'package:source_maps/span.dart' show SourceFile; 5 import 'package:source_maps/span.dart' show SourceFile;
6 import 'char_encodings.dart'; 6 import 'char_encodings.dart';
7 import 'constants.dart'; 7 import 'constants.dart';
8 import 'utils.dart'; 8 import 'utils.dart';
9 import 'encoding_parser.dart'; 9 import 'encoding_parser.dart';
10 10
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 /** 299 /**
300 * Return the python codec name corresponding to an encoding or null if the 300 * Return the python codec name corresponding to an encoding or null if the
301 * string doesn't correspond to a valid encoding. 301 * string doesn't correspond to a valid encoding.
302 */ 302 */
303 String codecName(String encoding) { 303 String codecName(String encoding) {
304 final asciiPunctuation = new RegExp( 304 final asciiPunctuation = new RegExp(
305 "[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]"); 305 "[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]");
306 306
307 if (encoding == null) return null; 307 if (encoding == null) return null;
308 var canonicalName = encoding.replaceAll(asciiPunctuation, '').toLowerCase(); 308 var canonicalName = encoding.replaceAll(asciiPunctuation, '').toLowerCase();
309 return encodings[canonicalName]; 309 return ENCODINGS[canonicalName];
310 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698