summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorOliver Middleton <olliemail27@gmail.com>2017-04-06 13:09:20 +0100
committerOliver Middleton <olliemail27@gmail.com>2017-04-06 13:09:20 +0100
commitf9fb381b2a13260c3fcdae2f6d9546ab2c87e717 (patch)
tree3c5a52c16c1f5a25f5d2288b858e45fd7bfb0688 /src/test/rustdoc
parente5e92753cc3e12c3c468b6badaf340fe4443145c (diff)
downloadrust-f9fb381b2a13260c3fcdae2f6d9546ab2c87e717.tar.gz
rust-f9fb381b2a13260c3fcdae2f6d9546ab2c87e717.zip
rustdoc: Use pulldown-cmark for Markdown HTML rendering
Instead of rendering all of the HTML in rustdoc this relies on
pulldown-cmark's `push_html` to do most of the work. A few iterator
adapters are used to make rustdoc specific modifications to the output.

This also fixes MarkdownHtml and link titles in plain_summary_line.
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/check-hard-break.rs3
-rw-r--r--src/test/rustdoc/check-rule-image-footnote.rs14
-rw-r--r--src/test/rustdoc/test-lists.rs14
3 files changed, 20 insertions, 11 deletions
diff --git a/src/test/rustdoc/check-hard-break.rs b/src/test/rustdoc/check-hard-break.rs
index 5c5e3f8136c..f048b64d104 100644
--- a/src/test/rustdoc/check-hard-break.rs
+++ b/src/test/rustdoc/check-hard-break.rs
@@ -13,7 +13,8 @@
 // ignore-tidy-end-whitespace
 
 // @has foo/fn.f.html
-// @has - '<p>hard break:<br>after hard break</p>'
+// @has - '<p>hard break:<br />'
+// @has - 'after hard break</p>'
 /// hard break:  
 /// after hard break
 pub fn f() {}
diff --git a/src/test/rustdoc/check-rule-image-footnote.rs b/src/test/rustdoc/check-rule-image-footnote.rs
index 4d3bea20ba8..46542677857 100644
--- a/src/test/rustdoc/check-rule-image-footnote.rs
+++ b/src/test/rustdoc/check-rule-image-footnote.rs
@@ -13,16 +13,21 @@
 // ignore-tidy-linelength
 
 // @has foo/fn.f.html
-// @has - '<p>markdown test</p><p>this is a <a href="https://example.com" title="this is a title">link</a>.</p><p>hard break: after hard break</p><hr><p>a footnote<sup id="supref1"><a href="#ref1">1</a></sup>.</p><p>another footnote<sup id="supref2"><a href="#ref2">2</a></sup>.</p><p><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="Rust"></p><div class="footnotes"><hr><ol><li id="ref1"><p>Thing&nbsp;<a href="#supref1" rev="footnote">↩</a></p></li><li id="ref2"><p>Another Thing&nbsp;<a href="#supref2" rev="footnote">↩</a></p></li></ol></div>'
+// @has - '<p>markdown test</p>'
+// @has - '<p>this is a <a href="https://example.com" title="this is a title">link</a>.</p>'
+// @has - '<hr />'
+// @has - '<p>a footnote<sup id="supref1"><a href="#ref1">1</a></sup>.</p>'
+// @has - '<p>another footnote<sup id="supref2"><a href="#ref2">2</a></sup>.</p>'
+// @has - '<p><img src="https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png" alt="Rust" /></p>'
+// @has - '<div class="footnotes"><hr><ol><li id="ref1">'
+// @has - '<p>Thing&nbsp;<a href="#supref1" rev="footnote">↩</a></p></li><li id="ref2">'
+// @has - '<p>Another Thing&nbsp;<a href="#supref2" rev="footnote">↩</a></p></li></ol></div>'
 /// markdown test
 ///
 /// this is a [link].
 ///
 /// [link]: https://example.com "this is a title"
 ///
-/// hard break:
-/// after hard break
-///
 /// -----------
 ///
 /// a footnote[^footnote].
@@ -36,5 +41,4 @@
 ///
 ///
 /// ![Rust](https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png)
-#[deprecated(note = "Struct<T>")]
 pub fn f() {}
diff --git a/src/test/rustdoc/test-lists.rs b/src/test/rustdoc/test-lists.rs
index 71a826a2bed..29f157e0425 100644
--- a/src/test/rustdoc/test-lists.rs
+++ b/src/test/rustdoc/test-lists.rs
@@ -10,10 +10,11 @@
 
 #![crate_name = "foo"]
 
-// ignore-tidy-linelength
-
 // @has foo/fn.f.html
-// @has - "<pre class='rust fn'>pub fn f()</pre><div class='docblock'><ol><li>list<ol><li>fooooo</li><li>x</li></ol></li><li>foo</li></ol>"
+// @has - //ol/li "list"
+// @has - //ol/li/ol/li "fooooo"
+// @has - //ol/li/ol/li "x"
+// @has - //ol/li "foo"
 /// 1. list
 ///     1. fooooo
 ///     2. x
@@ -21,7 +22,10 @@
 pub fn f() {}
 
 // @has foo/fn.foo2.html
-// @has - "<pre class='rust fn'>pub fn foo2()</pre><div class='docblock'><ul><li>normal list<ul><li><p>sub list</p></li><li><p>new elem still same elem</p><p>and again same elem!</p></li></ul></li><li>new big elem</li></ul>"
+// @has - //ul/li "normal list"
+// @has - //ul/li/ul/li "sub list"
+// @has - //ul/li/ul/li "new elem still same elem and again same elem!"
+// @has - //ul/li "new big elem"
 /// * normal list
 ///     * sub list
 ///     * new elem
@@ -29,4 +33,4 @@ pub fn f() {}
 ///
 ///       and again same elem!
 /// * new big elem
-pub fn foo2() {}
\ No newline at end of file
+pub fn foo2() {}