File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
crates/crates_io_markdown Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 22
33use ammonia:: { Builder , UrlRelative , UrlRelativeEvaluate } ;
44use comrak:: nodes:: { AstNode , NodeValue } ;
5+ use comrak:: ComrakOptions ;
56use htmlescape:: encode_minimal;
67use std:: borrow:: Cow ;
78use std:: path:: Path ;
@@ -71,18 +72,20 @@ impl<'a> MarkdownRenderer<'a> {
7172 ComrakRenderOptions ,
7273 } ;
7374
74- let mut render_options = ComrakRenderOptions :: default ( ) ;
75- // The output will be sanitized with `ammonia`
76- render_options. unsafe_ = true ;
77-
78- let mut extension_options = ComrakExtensionOptions :: default ( ) ;
79- extension_options. autolink = true ;
80- extension_options. strikethrough = true ;
81- extension_options. table = true ;
82- extension_options. tagfilter = true ;
83- extension_options. tasklist = true ;
84- extension_options. header_ids = Some ( "user-content-" . to_string ( ) ) ;
85- extension_options. footnotes = true ;
75+ let render_options = ComrakRenderOptions :: builder ( )
76+ // The output will be sanitized with `ammonia`
77+ . unsafe_ ( true )
78+ . build ( ) ;
79+
80+ let extension_options = ComrakExtensionOptions :: builder ( )
81+ . autolink ( true )
82+ . strikethrough ( true )
83+ . table ( true )
84+ . tagfilter ( true )
85+ . tasklist ( true )
86+ . header_ids ( "user-content-" . to_string ( ) )
87+ . footnotes ( true )
88+ . build ( ) ;
8689
8790 let options = ComrakOptions {
8891 render : render_options,
You can’t perform that action at this time.
0 commit comments