diff --git a/CHANGELOG.md b/CHANGELOG.md index caa916b..39180dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Dradis Framework 3.16 (XXXX, 2020) ## + +* Update tag parsing to remove formatting tags + ## Dradis Framework 3.15 (November, 2019) ## * Wrap ciphers in code blocks diff --git a/lib/nexpose/vulnerability.rb b/lib/nexpose/vulnerability.rb index 4915bbf..6498ca3 100644 --- a/lib/nexpose/vulnerability.rb +++ b/lib/nexpose/vulnerability.rb @@ -111,15 +111,21 @@ def add_bc_to_ssl_cipher_list(source) def cleanup_html(source) result = source.to_s - result.gsub!(/(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"} - result.gsub!(/(.*?)<\/Paragraph>/m){|m| "\nbc. #{ $1 }\n\n"} - result.gsub!(/(.*?)<\/Paragraph>/m){|m| "#{ $1 }\n"} + result.gsub!(/\s*(.*?)<\/Paragraph>/im){|m| "\nbc. #{ $1 }\n\n"} + result.gsub!(/(.*?)<\/Paragraph>/m){|m| "#{ $1 }"} result.gsub!(//, '') result.gsub!(/<\/Paragraph>/, '') - result.gsub!(/(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"} - result.gsub!(/(.*?)<\/ListItem>/m){|m| "#{ $1 }\n"} result.gsub!(/ /, '') result.gsub!(/\t\t/, '') + + result.gsub!(/\s(.*?)<\/ContainerBlockElement>/m){|m| "#{ $1 }"} + result.gsub!(/\s(.*?)<\/UnorderedList>/m){|m| "#{ $1 }"} + result.gsub!(/\s|<\/UnorderedList>/){"#{ $1 }"} + result.gsub!(/\s(.*?)<\/OrderedList>/m){|m| "#{ $1 }"} + result.gsub!(/\s(.*?)<\/ListItem>/){"* #{ $1 }\n"} + result.gsub!(/\s\n\s(.*?)/){"* #{ $1 }\n"} + result.gsub!(/\s/i) {"* #{ $1 }\n"} + result.gsub!(/<\/ListItem>/i) {"#{ $1 }\n"} result.gsub!(//i) { "\"#{$1.strip}\":#{$2.strip} " } result.gsub!(//i) { "\"#{$2.strip}\":#{$1.strip} " } result.gsub!(/(.*?)<\/URLLink>/m) {|m| "\"#{$4.strip}\":#{$2.strip} " }