fix warnings

pull/2375/head
Gergely Gombos 1 month ago
parent d6df6b5135
commit d8eb56811e

@ -6,7 +6,7 @@ module Docs
# Remove breadcrumbs before h1
css('h1').each do |node|
if (node.previous)
if node.previous
node.previous.remove
end
end

@ -3,7 +3,8 @@ module Docs
class EntriesReactDevFilter < Docs::EntriesFilter
def get_name
name = at_css('article h1')&.content
return update_canary_copy(name)
update_canary_copy(name)
end
def get_type
@ -17,12 +18,14 @@ module Docs
&.concat(": ")
is_learn_page = path.start_with?('learn/') || slug == 'learn'
prefix = is_learn_page ? 'Learn: ' : top_category || ''
return update_canary_copy(prefix + (category || 'Miscellaneous'))
update_canary_copy(prefix + (category || 'Miscellaneous'))
end
def update_canary_copy(string)
canary_copy = '- This feature is available in the latest Canary'
return string.sub(canary_copy, ' (Canary)')
string.sub(canary_copy, ' (Canary)')
end
def additional_entries
@ -34,7 +37,8 @@ module Docs
next if excluded.include?(name.downcase)
entries << [name, node['id'], type]
end
return entries
entries
end
end
end

Loading…
Cancel
Save