Update node to 16.2.0.

- Fix bugs introduced by new style in code blocks.
This commit is contained in:
Enoc 2021-05-20 00:08:08 -06:00
parent 83c59a5a4d
commit cce7c49152
2 changed files with 20 additions and 4 deletions

View file

@ -4,6 +4,24 @@ module Docs
def call
css('hr').remove
css('pre').each do |node|
next unless (node.css('code').to_a.length > 1)
node.css('code').each do |subnode|
if subnode.classes.include?('mjs')
node.before('<p class=module-type>MJS modules</p>')
elsif subnode.classes.include?('cjs')
node.before('<p class=module-type>CJS modules</p>')
end
node.before(subnode)
subnode.wrap('<pre>')
end
node.remove
end
# Remove "#" links
css('.mark').each do |node|
node.parent.parent['id'] = node['id']
@ -17,9 +35,7 @@ module Docs
css('pre').each do |node|
next unless node.at_css('code')
if lang = node.at_css('code')['class']
node['data-language'] = lang.remove(%r{lang(uage)?-})
end
node['data-language'] = 'js'
node.content = node.content
end

View file

@ -24,7 +24,7 @@ module Docs
HTML
version do
self.release = '16.1.0'
self.release = '16.2.0'
self.base_url = 'https://nodejs.org/api/'
end