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

Unified Diff: third_party/pkg/markdown/test/markdown_test.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/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/markdown/test/markdown_test.dart
diff --git a/third_party/pkg/markdown/test/markdown_test.dart b/third_party/pkg/markdown/test/markdown_test.dart
index 3c4564b13f5e7cc948b17d8a5fa72c4b734ab485..e1cc81fc41a0baca51fc5ad739a7beecdf8d181c 100644
--- a/third_party/pkg/markdown/test/markdown_test.dart
+++ b/third_party/pkg/markdown/test/markdown_test.dart
@@ -862,6 +862,94 @@ void main() {
''');
});
+ group('Inline Images', () {
+ validate('image','''
+ ![](http://foo.com/foo.png)
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png">
+ <img src="http://foo.com/foo.png"></img>
+ </a>
+ </p>
+ ''');
+
+ validate('alternate text','''
+ ![alternate text](http://foo.com/foo.png)
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png">
+ <img alt="alternate text" src="http://foo.com/foo.png"></img>
+ </a>
+ </p>
+ ''');
+
+ validate('title','''
+ ![](http://foo.com/foo.png "optional title")
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png" title="optional title">
+ <img src="http://foo.com/foo.png" title="optional title"></img>
+ </a>
+ </p>
+ ''');
+ validate('invalid alt text','''
+ ![`alt`](http://foo.com/foo.png)
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png">
+ <img src="http://foo.com/foo.png"></img>
+ </a>
+ </p>
+ ''');
+ });
+
+ group('Reference Images', () {
+ validate('image','''
+ ![][foo]
+ [foo]: http://foo.com/foo.png
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png">
+ <img src="http://foo.com/foo.png"></img>
+ </a>
+ </p>
+ ''');
+
+ validate('alternate text','''
+ ![alternate text][foo]
+ [foo]: http://foo.com/foo.png
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png">
+ <img alt="alternate text" src="http://foo.com/foo.png"></img>
+ </a>
+ </p>
+ ''');
+
+ validate('title','''
+ ![][foo]
+ [foo]: http://foo.com/foo.png "optional title"
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png" title="optional title">
+ <img src="http://foo.com/foo.png" title="optional title"></img>
+ </a>
+ </p>
+ ''');
+
+ validate('invalid alt text','''
+ ![`alt`][foo]
+ [foo]: http://foo.com/foo.png "optional title"
+ ''','''
+ <p>
+ <a href="http://foo.com/foo.png" title="optional title">
+ <img src="http://foo.com/foo.png" title="optional title"></img>
+ </a>
+ </p>
+ ''');
+
+ });
+
group('Resolver', () {
var nyanResolver = (text) => new Text('~=[,,_${text}_,,]:3');
validate('simple resolver', '''
« no previous file with comments | « third_party/pkg/markdown/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698