Support tables

bug/bundler_fix
wchen-r7 2016-03-08 12:19:27 -06:00
parent 860159fa00
commit f831d58c1c
2 changed files with 13 additions and 3 deletions

View File

@ -13,13 +13,11 @@ Older versions of Tomcat came with default passwords enabled by default. For exa
**Tomcat 4**
```
| Username | Password | Role |
| -------- | -------- | ------------- |
| tomcat | tomcat | tomcat |
| role1 | tomcat | role1 |
| both | tomcat | tomcat, role1 |
```
**Tomcat 5**

View File

@ -28,10 +28,15 @@ module Redcarpet
%Q|<h#{header_level}>#{text}</h#{header_level}><hr>|
end
def table(header, body)
%Q|<table class="kb_table" cellpadding="5" cellspacing="2" border="1">#{header}#{body}</table><br>|
end
end
end
end
module Msf
module Util
module DocumentGenerator
@ -97,7 +102,14 @@ module Msf
# @param kb [String] Additional information to add.
# @return [String] HTML document.
def md_to_html(md, kb)
r = Redcarpet::Markdown.new(Redcarpet::Render::MsfMdHTML, fenced_code_blocks: true, no_intra_emphasis: true, escape_html: true)
opts = {
fenced_code_blocks: true,
no_intra_emphasis: true,
escape_html: true,
tables: true
}
r = Redcarpet::Markdown.new(Redcarpet::Render::MsfMdHTML, opts)
ERB.new(@html_template ||= lambda {
html_template = ''
path = File.expand_path(File.join(Msf::Config.data_directory, 'markdown_doc', HTML_TEMPLATE))