File tree 1 file changed +20
-19
lines changed
1 file changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -69,27 +69,28 @@ fn render_with_highlighter(
69
69
text : & str ,
70
70
highlighter : impl Fn ( Option < & str > , & str ) -> String + Send + Sync ,
71
71
) -> String {
72
- let mut extension = ExtensionOptions :: default ( ) ;
73
- extension. superscript = true ;
74
- extension. table = true ;
75
- extension. autolink = true ;
76
- extension. tasklist = true ;
77
- extension. strikethrough = true ;
78
-
79
- let options = Options {
80
- extension,
81
- ..Default :: default ( )
82
- } ;
83
-
84
72
let code_adapter = CodeAdapter ( highlighter) ;
85
73
86
- let mut render = RenderPlugins :: default ( ) ;
87
- render. codefence_syntax_highlighter = Some ( & code_adapter) ;
88
-
89
- let mut plugins = Plugins :: default ( ) ;
90
- plugins. render = render;
91
-
92
- comrak:: markdown_to_html_with_plugins ( text, & options, & plugins)
74
+ comrak:: markdown_to_html_with_plugins (
75
+ text,
76
+ & Options {
77
+ extension : ExtensionOptions {
78
+ superscript : true ,
79
+ table : true ,
80
+ autolink : true ,
81
+ tasklist : true ,
82
+ strikethrough : true ,
83
+ ..Default :: default ( )
84
+ } ,
85
+ ..Default :: default ( )
86
+ } ,
87
+ & Plugins {
88
+ render : RenderPlugins {
89
+ codefence_syntax_highlighter : Some ( & code_adapter) ,
90
+ ..Default :: default ( )
91
+ } ,
92
+ } ,
93
+ )
93
94
}
94
95
95
96
/// Wrapper around the Markdown parser and renderer to render markdown
You can’t perform that action at this time.
0 commit comments