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

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

Issue 19220006: Updated the schema of the yaml output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 a481aca4b440377c0238d67aff1785b13a907ac5..cccb8eb084cec52be21ec3ee46de633dbd7f6e61 100644
--- a/pkg/docgen/lib/dart2yaml.dart
+++ b/pkg/docgen/lib/dart2yaml.dart
@@ -52,8 +52,11 @@ 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('\\', '\\\\')
- .replaceAll("\"", "\\\"")}\"\n";
+ var contents = element.toString()
+ .replaceAll('\\', r'\\')
+ .replaceAll('"', r'\"')
+ .replaceAll('\n', r'\n');
+ return '"$contents"\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