Fix minor issues of the compatibility tables

pull/1514/head
Enoc 4 years ago
parent 0ad6fefa83
commit 5b3e3b3e53

@ -1,7 +1,6 @@
module CompatTables
require 'json'
require 'net/http'
require 'pry'
BROWSERS = {
'chrome' => 'Chrome',
@ -36,7 +35,7 @@ module CompatTables
uris = []
index_json['doc']['body'].each do |element|
uris.push(element['value']['dataURL']) if element['type'] == 'browser_compatibility'
uris.push(element['value']['dataURL']) if element['type'] == 'browser_compatibility' and element['value']['dataURL']
end
uris.map! do |uri|
@ -94,7 +93,13 @@ module CompatTables
last_table_entry = html_table.at_css('tbody').last_element_child
if key == '__compat'
tmp = slug.split('/')
last_table_entry.add_child("<th><code>#{tmp.last}")
else
last_table_entry.add_child("<th><code>#{key}")
end
BROWSERS.keys.each do |browser_key|
if key == '__compat'
@ -111,6 +116,7 @@ module CompatTables
version_removed = []
notes = []
if json
if json.is_a?(Array)
json.each do |element|
@ -178,6 +184,10 @@ module CompatTables
end
end
else
format_string = "<td class=bc-supports-no><div>?</div></td>"
end
entry.add_child(format_string)
end

Loading…
Cancel
Save