Update Rust documentation (1.71.0)

Fixes #1881.
pull/2020/head
Simon Legner 2 years ago
parent a32e3d0522
commit 03dfcf56ef

@ -88,8 +88,12 @@ module Docs
end
css('pre').each do |node|
node.css('.where.fmt-newline').each do |node|
node.before("\n")
end
node.content = node.content
node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust')
node['data-language'] = 'rust' if node.classes.include?('code-header')
end
doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'

@ -53,5 +53,10 @@ module Docs
def process_response?(response)
!(response.body =~ REDIRECT_RGX || response.body =~ NOT_FOUND_RGX || response.body.blank?)
end
def parse(response) # Hook here because Nokogori removes whitespace from headings
response.body.gsub! %r{<h[1-6] class="code-header">}, '<pre class="code-header">'
super
end
end
end

Loading…
Cancel
Save