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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/markdown/lib/src/util.dart
diff --git a/third_party/pkg/markdown/lib/src/util.dart b/third_party/pkg/markdown/lib/src/util.dart
index a6d52de8ac115bebf6e6bc8f85789f524c3c05b9..2da80da2966fee0fd3d580da59bed622c9e942de 100644
--- a/third_party/pkg/markdown/lib/src/util.dart
+++ b/third_party/pkg/markdown/lib/src/util.dart
@@ -2,7 +2,21 @@ library markdown.util;
/// Replaces `<`, `&`, and `>`, with their HTML entity equivalents.
String escapeHtml(String html) {
+ if (html == '' || html == null) return null;
return html.replaceAll('&', '&amp;')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;');
}
+
+/// Removes null or empty values from [map].
+void cleanMap(Map map) {
+ map.keys
+ .where((e) => isNullOrEmpty(map[e]))
+ .toList()
+ .forEach(map.remove);
+}
+
+/// Returns true if an object is null or an empty string.
+bool isNullOrEmpty(object) {
+ return object == null || object == '';
+}
« 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