File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
lib/msf/util/document_generator Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def get_md_content(items, kb)
78
78
File . open ( path , 'rb' ) { |f | template = f . read }
79
79
return template
80
80
} . call
81
- md_to_html ( ERB . new ( @md_template ) . result ( binding ( ) ) , kb . gsub ( /</ , '<' ) )
81
+ md_to_html ( ERB . new ( @md_template ) . result ( binding ( ) ) , kb )
82
82
end
83
83
84
84
@@ -104,14 +104,18 @@ def load_css
104
104
# @param kb [String] Additional information to add.
105
105
# @return [String] HTML document.
106
106
def md_to_html ( md , kb )
107
- opts = {
107
+ extensions = {
108
+ escape_html : true
109
+ }
110
+
111
+ render_options = {
108
112
fenced_code_blocks : true ,
109
113
no_intra_emphasis : true ,
110
- escape_html : true ,
111
114
tables : true
112
115
}
113
116
114
- r = Redcarpet ::Markdown . new ( Redcarpet ::Render ::MsfMdHTML , opts )
117
+ html_renderer = Redcarpet ::Render ::MsfMdHTML . new ( extensions )
118
+ r = Redcarpet ::Markdown . new ( html_renderer , render_options )
115
119
ERB . new ( @html_template ||= lambda {
116
120
html_template = ''
117
121
path = File . expand_path ( File . join ( Msf ::Config . data_directory , 'markdown_doc' , HTML_TEMPLATE ) )
You can’t perform that action at this time.
0 commit comments