File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1- use std:: io :: Write ;
1+ use std:: fmt :: Write ;
22use std:: sync:: Mutex ;
33
44use comrak:: adapters:: { HeadingAdapter , HeadingMeta } ;
@@ -53,14 +53,14 @@ impl HeadingAdapter for MdPageHeadingAdapter {
5353 output : & mut dyn Write ,
5454 heading : & HeadingMeta ,
5555 _sourcepos : Option < Sourcepos > ,
56- ) -> std:: io :: Result < ( ) > {
56+ ) -> std:: fmt :: Result {
5757 if heading. level == 1 {
5858 return write ! ( output, "<h{}>" , heading. level) ;
5959 }
6060
6161 let anchor = {
6262 let mut anchorizer = self . anchorizer . lock ( ) . unwrap ( ) ;
63- anchorizer. anchorize ( heading. content . clone ( ) )
63+ anchorizer. anchorize ( & heading. content )
6464 } ;
6565
6666 {
@@ -81,7 +81,7 @@ impl HeadingAdapter for MdPageHeadingAdapter {
8181 )
8282 }
8383
84- fn exit ( & self , output : & mut dyn Write , heading : & HeadingMeta ) -> std:: io :: Result < ( ) > {
84+ fn exit ( & self , output : & mut dyn Write , heading : & HeadingMeta ) -> std:: fmt :: Result {
8585 write ! ( output, "</h{}>" , heading. level)
8686 }
8787}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ pub(super) fn parse_md_page(prefix: &str, link: &str) -> MdPage {
9191 options. extension . table = true ;
9292 options. extension . front_matter_delimiter = Some ( "---" . to_string ( ) ) ;
9393 options. parse . smart = true ;
94- options. render . unsafe_ = true ;
94+ options. render . r#unsafe = true ;
9595
9696 let heading_adapter = MdPageHeadingAdapter {
9797 anchorizer : Mutex :: new ( comrak:: Anchorizer :: new ( ) ) ,
@@ -107,11 +107,13 @@ pub(super) fn parse_md_page(prefix: &str, link: &str) -> MdPage {
107107 . expect ( "failed to load syntax set" ) ,
108108 )
109109 . build ( ) ;
110- let render_plugins = comrak:: RenderPlugins :: builder ( )
110+ let render_plugins = comrak:: options :: RenderPlugins :: builder ( )
111111 . codefence_syntax_highlighter ( & syntax_highlighter)
112112 . heading_adapter ( & heading_adapter)
113113 . build ( ) ;
114- let plugins = comrak:: Plugins :: builder ( ) . render ( render_plugins) . build ( ) ;
114+ let plugins = comrak:: options:: Plugins :: builder ( )
115+ . render ( render_plugins)
116+ . build ( ) ;
115117
116118 let md_page_content =
117119 comrak:: markdown_to_html_with_plugins ( & md_page_content, & options, & plugins) ;
You can’t perform that action at this time.
0 commit comments