File tree Expand file tree Collapse file tree 3 files changed +90
-16
lines changed Expand file tree Collapse file tree 3 files changed +90
-16
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ path = "lib.rs"
11
11
12
12
[dependencies ]
13
13
ammonia = " =3.3.0"
14
- comrak = { version = " =0.18 .0" , default-features = false }
14
+ comrak = { version = " =0.19 .0" , default-features = false }
15
15
htmlescape = " =0.3.1"
16
16
url = " =2.4.1"
Original file line number Diff line number Diff line change @@ -61,20 +61,21 @@ impl<'a> MarkdownRenderer<'a> {
61
61
ComrakRenderOptions ,
62
62
} ;
63
63
64
+ let mut render_options = ComrakRenderOptions :: default ( ) ;
65
+ // The output will be sanitized with `ammonia`
66
+ render_options. unsafe_ = true ;
67
+
68
+ let mut extension_options = ComrakExtensionOptions :: default ( ) ;
69
+ extension_options. autolink = true ;
70
+ extension_options. strikethrough = true ;
71
+ extension_options. table = true ;
72
+ extension_options. tagfilter = true ;
73
+ extension_options. tasklist = true ;
74
+ extension_options. header_ids = Some ( "user-content-" . to_string ( ) ) ;
75
+
64
76
let options = ComrakOptions {
65
- render : ComrakRenderOptions {
66
- unsafe_ : true , // The output will be sanitized with `ammonia`
67
- ..ComrakRenderOptions :: default ( )
68
- } ,
69
- extension : ComrakExtensionOptions {
70
- autolink : true ,
71
- strikethrough : true ,
72
- table : true ,
73
- tagfilter : true ,
74
- tasklist : true ,
75
- header_ids : Some ( "user-content-" . to_string ( ) ) ,
76
- ..ComrakExtensionOptions :: default ( )
77
- } ,
77
+ render : render_options,
78
+ extension : extension_options,
78
79
..ComrakOptions :: default ( )
79
80
} ;
80
81
You can’t perform that action at this time.
0 commit comments