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

Side by Side Diff: pkg/polymer/tool/create_message_details_page.dart

Issue 711783002: make sure not to interpret things inside messages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Simple script to generate a page summarizing all error messages produces by 5 /// Simple script to generate a page summarizing all error messages produces by
6 /// the polymer compiler code. The generated code will be placed directly under 6 /// the polymer compiler code. The generated code will be placed directly under
7 /// the `polymer/lib/src/generated` folder. This script should be invoked from 7 /// the `polymer/lib/src/generated` folder. This script should be invoked from
8 /// the root of the polymer package either by doing: 8 /// the root of the polymer package either by doing:
9 /// 9 ///
10 /// dart tool/create_message_details_page.dart 10 /// dart tool/create_message_details_page.dart
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 templates.add(template); 77 templates.add(template);
78 }); 78 });
79 } 79 }
80 80
81 _generateMessage(MessageTemplate template, bool forSite, StringBuffer sb) { 81 _generateMessage(MessageTemplate template, bool forSite, StringBuffer sb) {
82 var details = template.details == null 82 var details = template.details == null
83 ? 'No details available' : template.details; 83 ? 'No details available' : template.details;
84 var id = template.id; 84 var id = template.id;
85 var hashTag = '${id.package}_${id.id}'; 85 var hashTag = '${id.package}_${id.id}';
86 var title = '### ${template.description} [#${id.id}](#$hashTag)'; 86 var title = '### ${template.description} [#${id.id}](#$hashTag)';
87 var body = '\n$details\n\n----\n\n'; 87 var body = '\n{% raw %}$details{% endraw %}\n\n----\n\n';
88 // We add the anchor inside the <h3> title, otherwise the link doesn't work. 88 // We add the anchor inside the <h3> title, otherwise the link doesn't work.
89 if (forSite) { 89 if (forSite) {
90 sb..write(title) 90 sb..write(title)
91 ..write('\n{: #$hashTag}\n') 91 ..write('\n{: #$hashTag}\n')
92 ..write(body); 92 ..write(body);
93 } else { 93 } else {
94 var html = markdownToHtml('$title$body').replaceFirst('<hr', '</div><hr'); 94 var html = markdownToHtml('$title$body').replaceFirst('<hr', '</div><hr');
95 sb.write('\n\n<div id="$hashTag">$html'); 95 sb.write('\n\n<div id="$hashTag">$html');
96 } 96 }
97 } 97 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 display: inline; 270 display: inline;
271 } 271 }
272 </style> 272 </style>
273 <body> 273 <body>
274 '''; 274 ''';
275 275
276 const _LOCAL_FOOTER = ''' 276 const _LOCAL_FOOTER = '''
277 </body> 277 </body>
278 </html> 278 </html>
279 '''; 279 ''';
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698