Update Node.js documentation (18.8.0)

Retain original element IDs for correct anchor links.

Fixes #1721.
pull/1812/head
Simon Legner 2 years ago
parent ebe281a1c5
commit d8306efebc

@ -40,19 +40,6 @@ module Docs
node.content = node.content
end
css('h3 > code, h4 > code, h5 > code').each do |node|
tmp = node.content
has_parethesis = true if tmp =~ /\(/
tmp.gsub!(/\(.*\)/, '')
if has_parethesis
tmp << '()'
end
node.parent['id'] = tmp
end
doc
end
end

@ -14,18 +14,20 @@ module Docs
entries = []
css('h3 > code, h4 > code, h5 > code').each do |node|
name = node.content.gsub(/\(.*\)/, '()')
id = node.parent['id']
case node.parent.child.content
when /Class/
entries << ["Class #{node.parent['id']}", node.parent['id'], type]
entries << ["Class #{name}", id, type]
when /Event/
entries << ["Event #{node.parent['id']}", node.parent['id'], type]
entries << ["Event #{name}", id, type]
end
if node.parent.child.is_a?(Nokogiri::XML::Text)
next
else
entries << [node.parent['id'], node.parent['id'], type]
entries << [name, id, type]
end
end

Loading…
Cancel
Save