From f9fb381b2a13260c3fcdae2f6d9546ab2c87e717 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Thu, 6 Apr 2017 13:09:20 +0100 Subject: 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. --- src/test/rustdoc/check-hard-break.rs | 3 ++- src/test/rustdoc/check-rule-image-footnote.rs | 14 +++++++++----- src/test/rustdoc/test-lists.rs | 14 +++++++++----- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'src/test/rustdoc') 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 - '

hard break:
after hard break

' +// @has - '

hard break:
' +// @has - 'after hard break

' /// 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 - '

markdown test

this is a link.

hard break: after hard break


a footnote1.

another footnote2.

Rust


  1. Thing 

  2. Another Thing 

' +// @has - '

markdown test

' +// @has - '

this is a link.

' +// @has - '
' +// @has - '

a footnote1.

' +// @has - '

another footnote2.

' +// @has - '

Rust

' +// @has - '

  1. ' +// @has - '

    Thing 

  2. ' +// @has - '

    Another Thing 

' /// 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")] 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 - "
pub fn f()
  1. list
    1. fooooo
    2. x
  2. foo
" +// @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 - "
pub fn foo2()
  • normal list
    • sub list

    • new elem still same elem

      and again same elem!

  • new big elem
" +// @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() {} -- cgit 1.4.1-3-g733a5