@@ -4,22 +4,20 @@ use crate::util::unwrap;
44use crate :: ManMap ;
55use anyhow:: { bail, format_err, Error } ;
66use std:: fmt:: Write ;
7- use url:: Url ;
87
98pub struct MdFormatter {
10- url : Option < Url > ,
119 man_map : ManMap ,
1210}
1311
1412impl MdFormatter {
15- pub fn new ( url : Option < Url > , man_map : ManMap ) -> MdFormatter {
16- MdFormatter { url , man_map }
13+ pub fn new ( man_map : ManMap ) -> MdFormatter {
14+ MdFormatter { man_map }
1715 }
1816}
1917
2018impl MdFormatter {
2119 fn render_html ( & self , input : & str ) -> Result < String , Error > {
22- let parser = crate :: md_parser ( input, self . url . clone ( ) ) ;
20+ let parser = crate :: md_parser ( input, None ) ;
2321 let mut html_output: String = String :: with_capacity ( input. len ( ) * 3 / 2 ) ;
2422 pulldown_cmark:: html:: push_html ( & mut html_output, parser. map ( |( e, _r) | e) ) ;
2523 Ok ( html_output)
@@ -78,7 +76,7 @@ impl super::Formatter for MdFormatter {
7876 fn linkify_man_to_md ( & self , name : & str , section : u8 ) -> Result < String , Error > {
7977 let s = match self . man_map . get ( & ( name. to_string ( ) , section) ) {
8078 Some ( link) => format ! ( "[{}({})]({})" , name, section, link) ,
81- None => format ! ( "[{}({})]({}.md )" , name, section, name) ,
79+ None => format ! ( "[{}({})]({}.html )" , name, section, name) ,
8280 } ;
8381 Ok ( s)
8482 }
0 commit comments