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

Side by Side Diff: third_party/pkg/markdown/lib/src/util.dart

Issue 217033005: Updated markdown library. This adds support for images in the doccumentation! (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added myself to AUTHORS file Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library markdown.util; 1 library markdown.util;
2 2
3 /// Replaces `<`, `&`, and `>`, with their HTML entity equivalents. 3 /// Replaces `<`, `&`, and `>`, with their HTML entity equivalents.
4 String escapeHtml(String html) { 4 String escapeHtml(String html) {
5 if (html == '' || html == null) return null;
5 return html.replaceAll('&', '&amp;') 6 return html.replaceAll('&', '&amp;')
6 .replaceAll('<', '&lt;') 7 .replaceAll('<', '&lt;')
7 .replaceAll('>', '&gt;'); 8 .replaceAll('>', '&gt;');
8 } 9 }
10
11 /// Removes null or empty values from [map].
12 void cleanMap(Map map) {
13 map.keys
14 .where((e) => isNullOrEmpty(map[e]))
15 .toList()
16 .forEach(map.remove);
17 }
18
19 /// Returns true if an object is null or an empty string.
20 bool isNullOrEmpty(object) {
21 return object == null || object == '';
22 }
OLDNEW
« no previous file with comments | « third_party/pkg/markdown/lib/src/inline_parser.dart ('k') | third_party/pkg/markdown/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698