File tree Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Expand file tree Collapse file tree 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(
6969 text : & str ,
7070 highlighter : impl Fn ( Option < & str > , & str ) -> String + Send + Sync ,
7171) -> 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-
8472 let code_adapter = CodeAdapter ( highlighter) ;
8573
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+ )
9394}
9495
9596/// Wrapper around the Markdown parser and renderer to render markdown
You can’t perform that action at this time.
0 commit comments