Commit 625e0d0d by Guillermo Guerrero Ibarra Committed by Cuong Tran

Fix bug, the max array can contains a nil values. (#432)

parent 866a23a5
......@@ -41,9 +41,10 @@ module AnnotateRoutes
return out if routes_map.size.zero?
maxs = [HEADER_ROW.map(&:size)] + routes_map[1..-1].map { |line| line.split.map(&:size) }
max = maxs.map(&:max).max
if options[:format_markdown]
max = maxs.map(&:max).compact.max
out += ["# #{content(HEADER_ROW, maxs, options)}"]
out += ["# #{content(['-' * max, '-' * max, '-' * max, '-' * max], maxs, options)}"]
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment