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

Unified Diff: pkg/docgen/lib/dart2yaml.dart

Issue 18112004: Escaping backslashes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/dart2yaml.dart
diff --git a/pkg/docgen/lib/dart2yaml.dart b/pkg/docgen/lib/dart2yaml.dart
index a03c7f1a2718f2207e73ebc7b62e9f7dc0ba29e0..a481aca4b440377c0238d67aff1785b13a907ac5 100644
--- a/pkg/docgen/lib/dart2yaml.dart
+++ b/pkg/docgen/lib/dart2yaml.dart
@@ -52,7 +52,8 @@ void _addLevel(StringBuffer yaml, Map documentData, int level) {
* Returns an escaped String form of the inputted element.
*/
String _processElement(var element) {
- return "\"${element.toString().replaceAll("\"", "\\\"")}\"\n";
+ return "\"${element.toString().replaceAll('\\', '\\\\')
+ .replaceAll("\"", "\\\"")}\"\n";
}
/**
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698