Skip to content

Commit b2d617b

Browse files
committed
Fix a bug in the markdown docs references
1 parent 44b08fe commit b2d617b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

lib/msf/util/document_generator/normalizer.rb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,25 @@ def normalize_targets(targets)
204204
# @param refs [Array] Module references.
205205
# @return [String]
206206
def normalize_references(refs)
207-
refs.collect { |r| "* <a href=\"#{r}\">#{r}</a>" } * "\n"
207+
normalized = ''
208+
refs.each do |ref|
209+
case ref.ctx_id
210+
when 'AKA'
211+
normalized << "* *Also known as:* #{ref.ctx_val}"
212+
when 'MSB'
213+
normalized << "* [#{ref.ctx_val}](#{ref.site})"
214+
when 'URL'
215+
normalized << "* [#{ref.site}](#{ref.site})"
216+
when 'US-CERT-VU'
217+
normalized << "* [VU##{ref.ctx_val}](#{ref.site})"
218+
else
219+
normalized << "* [#{ref.ctx_id}-#{ref.ctx_val}](#{ref.site})"
220+
end
221+
normalized << "\n"
222+
end
223+
normalized
208224
end
209225

210-
211226
# Returns the markdown format for module platforms.
212227
#
213228
# @param platforms [Array, String] Module platforms.

0 commit comments

Comments
 (0)