mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Update node to 16.2.0.
- Fix bugs introduced by new style in code blocks.
This commit is contained in:
parent
83c59a5a4d
commit
cce7c49152
2 changed files with 20 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue