OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.convert; | 5 part of dart.convert; |
6 | 6 |
7 /** | 7 /** |
8 * A `String` converter that converts characters to HTML entities. | 8 * A `String` converter that converts characters to HTML entities. |
9 * | 9 * |
10 * This is intended to sanitice text before inserting the text into an HTML | 10 * This is intended to sanitice text before inserting the text into an HTML |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 void addSlice(String chunk, int start, int end, bool isLast) { | 220 void addSlice(String chunk, int start, int end, bool isLast) { |
221 var val = _escape._convert(chunk, start, end); | 221 var val = _escape._convert(chunk, start, end); |
222 if(val == null) { | 222 if(val == null) { |
223 _sink.addSlice(chunk, start, end, isLast); | 223 _sink.addSlice(chunk, start, end, isLast); |
224 } else { | 224 } else { |
225 _sink.add(val); | 225 _sink.add(val); |
226 if (isLast) _sink.close(); | 226 if (isLast) _sink.close(); |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 void close() => _sink.close(); | 230 void close() { _sink.close(); } |
231 } | 231 } |
OLD | NEW |