Passing a Node as the second parameter to Node.new is deprecated. Please pass a Document instead, or prefer an alternative constructor like Node#add_child. This will become an error in a future release of Nokogiri.
Unified · Split
| @@ -23,7 +23,7 @@ module Docs · 22 unmodified lines | |||
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | def node(content) | 25 | def node(content) |
| 26 | node = Nokogiri::XML::Node.new 'h1', doc | 26 | node = Nokogiri::XML::Node.new 'h1', doc.document |
| 27 | node.content = content | 27 | node.content = content |
| 28 | node | 28 | node |
| 29 | end | 29 | end |
| @@ -111,7 +111,7 @@ module Docs · 110 unmodified lines | |||
| 111 | 111 | ||
| 112 | # temporary solution due lack of mathjax/mathml support | 112 | # temporary solution due lack of mathjax/mathml support |
| 113 | css('.t-mfrac').each do |node| | 113 | css('.t-mfrac').each do |node| |
| 114 | fraction = Nokogiri::XML::Node.new('span', doc) | 114 | fraction = Nokogiri::XML::Node.new('span', doc.document) |
| 115 | 115 | ||
| 116 | node.css('td').each do |node| | 116 | node.css('td').each do |node| |
| 117 | fraction.add_child("<span>#{node.content}</span>") | 117 | fraction.add_child("<span>#{node.content}</span>") |
| @@ -11,7 +11,7 @@ module Docs · 10 unmodified lines | |||
| 11 | css('.promo a').remove_attribute('style') | 11 | css('.promo a').remove_attribute('style') |
| 12 | 12 | ||
| 13 | # Translate source files links to DevDocs links | 13 | # Translate source files links to DevDocs links |
| 14 | links = Nokogiri::XML::Node.new('p', doc) | 14 | links = Nokogiri::XML::Node.new('p', doc.document) |
| 15 | links['class'] = '_links' | 15 | links['class'] = '_links' |
| 16 | 16 | ||
| 17 | css('a.github').each do |node| | 17 | css('a.github').each do |node| |
| @@ -8,7 +8,7 @@ module Docs · 7 unmodified lines | |||
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | css('ul[id].simple li:first-child:last-child').each do |node| | 10 | css('ul[id].simple li:first-child:last-child').each do |node| |
| 11 | heading = Nokogiri::XML::Node.new 'h3', doc | 11 | heading = Nokogiri::XML::Node.new 'h3', doc.document |
| 12 | heading['id'] = node.parent['id'] | 12 | heading['id'] = node.parent['id'] |
| 13 | heading.children = node.children | 13 | heading.children = node.children |
| 14 | node.parent.before(heading).remove | 14 | node.parent.before(heading).remove |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Groovy | 2 | class Groovy |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def new_node(content) | 4 | def new_node(content) |
| 5 | node = Nokogiri::XML::Node.new 'h1', doc | 5 | node = Nokogiri::XML::Node.new 'h1', doc.document |
| 6 | node.content = content | 6 | node.content = content |
| 7 | node | 7 | node |
| 8 | end | 8 | end |
| @@ -107,7 +107,7 @@ module Docs · 106 unmodified lines | |||
| 107 | end | 107 | end |
| 108 | 108 | ||
| 109 | def generate_basic_html_table | 109 | def generate_basic_html_table |
| 110 | table = Nokogiri::XML::Node.new('table', doc) | 110 | table = Nokogiri::XML::Node.new('table', doc.document) |
| 111 | 111 | ||
| 112 | table.add_child('<thead><tr id=bct-browser-type><tr id=bct-browsers><tbody>') | 112 | table.add_child('<thead><tr id=bct-browser-type><tr id=bct-browsers><tbody>') |
| 113 | 113 | ||
| @@ -7,7 +7,7 @@ module Docs · 6 unmodified lines | |||
| 7 | at_css('#mainCol').prepend_child at_css('#feature .wrapper').children | 7 | at_css('#mainCol').prepend_child at_css('#feature .wrapper').children |
| 8 | @doc = at_css('#mainCol') | 8 | @doc = at_css('#mainCol') |
| 9 | 9 | ||
| 10 | container = Nokogiri::XML::Node.new 'div', doc | 10 | container = Nokogiri::XML::Node.new 'div', doc.document |
| 11 | container['class'] = '_simple' | 11 | container['class'] = '_simple' |
| 12 | container.children = doc.children | 12 | container.children = doc.children |
| 13 | doc << container | 13 | doc << container |
| @@ -10,7 +10,7 @@ module Docs · 9 unmodified lines | |||
| 10 | container = at_css 'main' | 10 | container = at_css 'main' |
| 11 | 11 | ||
| 12 | # Add <dl> mentioning parent class and included modules | 12 | # Add <dl> mentioning parent class and included modules |
| 13 | meta = Nokogiri::XML::Node.new 'dl', doc | 13 | meta = Nokogiri::XML::Node.new 'dl', doc.document |
| 14 | meta['class'] = 'meta' | 14 | meta['class'] = 'meta' |
| 15 | 15 | ||
| 16 | if parent = at_css('#parent-class-section') | 16 | if parent = at_css('#parent-class-section') |
| @@ -229,14 +229,14 @@ module Docs · 228 unmodified lines | |||
| 229 | end | 229 | end |
| 230 | 230 | ||
| 231 | def convert_dl_to_table(dl) | 231 | def convert_dl_to_table(dl) |
| 232 | table = Nokogiri::XML::Node.new('table', doc) | 232 | table = Nokogiri::XML::Node.new('table', doc.document) |
| 233 | table['class'] = 'attributes' | 233 | table['class'] = 'attributes' |
| 234 | 234 | ||
| 235 | dl.css('> dt').each do |dt| | 235 | dl.css('> dt').each do |dt| |
| 236 | dd = dt.next_element | 236 | dd = dt.next_element |
| 237 | has_dd = dd.name == 'dd' rescue false | 237 | has_dd = dd.name == 'dd' rescue false |
| 238 | 238 | ||
| 239 | tr = Nokogiri::XML::Node.new('tr', doc) | 239 | tr = Nokogiri::XML::Node.new('tr', doc.document) |
| 240 | colspan = has_dd ? '' : ' colspan="2"' # handle <dt> without following <dt> | 240 | colspan = has_dd ? '' : ' colspan="2"' # handle <dt> without following <dt> |
| 241 | tr.add_child("<th#{colspan}>#{dt.inner_html.sub(/:$/, '')}</th>") | 241 | tr.add_child("<th#{colspan}>#{dt.inner_html.sub(/:$/, '')}</th>") |
| 242 | 242 | ||