Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 part of dart.convert; | |
| 6 | |
| 7 const HTML_ESCAPE = const HtmlEscape(); | |
| 8 | |
| 9 class HtmlEscape extends Converter<String, String> { | |
| 10 | |
| 11 const HtmlEscape(); | |
| 12 | |
| 13 String convert(String data) { | |
|
Jennifer Messerly
2013/08/26 23:01:28
I wonder if this impl should be based on HTML5 spe
Lasse Reichstein Nielsen
2013/08/27 06:07:40
We could have different escapes for different cont
Jennifer Messerly
2013/08/27 18:26:17
Using an enum for context SGTM. For attribute cont
| |
| 14 return data.replaceAll("&", "&") | |
| 15 .replaceAll("<", "<") | |
| 16 .replaceAll(">", ">") | |
| 17 .replaceAll('"', """) | |
| 18 .replaceAll("'", "'"); | |
|
Lasse Reichstein Nielsen
2013/08/27 06:07:40
This is horribly inefficient. It's ok as a first g
Jennifer Messerly
2013/08/27 18:26:17
+1
kevmoo-old
2013/08/27 20:52:23
Done.
kevmoo-old
2013/08/27 20:52:23
Done.
| |
| 19 } | |
| 20 } | |
| OLD | NEW |