mirror of
https://github.com/public-apis/public-apis.git
synced 2025-05-18 19:46:20 +02:00
remove extra whitespace
This commit is contained in:
parent
6289346b66
commit
fb28cbdbfd
1 changed files with 0 additions and 3 deletions
|
@ -34,18 +34,15 @@ sections = []
|
||||||
section_to_line_num = {}
|
section_to_line_num = {}
|
||||||
section_to_entries = Hash.new {|h,k| h[k] = Array.new }
|
section_to_entries = Hash.new {|h,k| h[k] = Array.new }
|
||||||
File.foreach(filename).with_index do | line, line_num |
|
File.foreach(filename).with_index do | line, line_num |
|
||||||
|
|
||||||
if line.start_with?('###')
|
if line.start_with?('###')
|
||||||
section = line.sub('###', '').lstrip.chop
|
section = line.sub('###', '').lstrip.chop
|
||||||
sections.push(section)
|
sections.push(section)
|
||||||
section_to_line_num[section] = line_num + 1
|
section_to_line_num[section] = line_num + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# Skip non-markdown table lines and table schema lines
|
# Skip non-markdown table lines and table schema lines
|
||||||
if !line.start_with?('|') || line.eql?("|---|---|---|---|---|\n")
|
if !line.start_with?('|') || line.eql?("|---|---|---|---|---|\n")
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
# char to check is the first column
|
# char to check is the first column
|
||||||
check_char = line.split("|")[1].strip.upcase
|
check_char = line.split("|")[1].strip.upcase
|
||||||
section_to_entries[section].push(check_char)
|
section_to_entries[section].push(check_char)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue