Showing the changes to lib/docs/filters/python (2 of 34 files). Show all
Unified · Split
| @@ -38,7 +38,7 @@ module Docs · 37 unmodified lines | ||
| 38 | 38 | node.css('a').each do |link| |
| 39 | 39 | link.before(link.children).remove |
| 40 | 40 | end |
| 41 | − node.child.content = node.child.content.sub @levelRegexp, '' | |
| 41 | + node.child.content = node.child.content.remove @levelRegexp | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | css('dt').each do |node| |
| @@ -15,8 +15,8 @@ module Docs · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | def get_name |
| 17 | 17 | name = at_css('h1').content |
| 18 | − name.sub! %r{\A[\d\.]+ }, '' # remove list number | |
| 19 | − name.sub! %r{ [\u{2013}\u{2014}].+\z}, '' # remove text after em/en dash | |
| 18 | + name.remove! %r{\A[\d\.]+ } # remove list number | |
| 19 | + name.remove! %r{ [\u{2013}\u{2014}].+\z} # remove text after em/en dash | |
| 20 | 20 | name |
| 21 | 21 | end |
| 22 | 22 | |
| @@ -33,10 +33,10 @@ module Docs · 10 unmodified lines | ||
| 33 | 33 | type = 'Internet Data Handling' |
| 34 | 34 | end |
| 35 | 35 | |
| 36 | − type.sub! %r{\A\d+\.\s+}, '' # remove list number | |
| 37 | − type.sub! "\u{00b6}", '' # remove paragraph character | |
| 36 | + type.remove! %r{\A\d+\.\s+} # remove list number | |
| 37 | + type.remove! "\u{00b6}" # remove paragraph character | |
| 38 | 38 | type.sub! ' and ', ' & ' |
| 39 | − [' Services', ' Modules', ' Specific', 'Python '].each { |str| type.sub! str, '' } | |
| 39 | + [' Services', ' Modules', ' Specific', 'Python '].each { |str| type.remove!(str) } | |
| 40 | 40 | |
| 41 | 41 | REPLACE_TYPES[type] || type |
| 42 | 42 | end |
| @@ -74,7 +74,7 @@ module Docs · 31 unmodified lines | ||
| 74 | 74 | def clean_id_attributes |
| 75 | 75 | css('.section > .target[id]').each do |node| |
| 76 | 76 | if dt = node.at_css('+ dl > dt') |
| 77 | − dt['id'] ||= node['id'].sub(/\w+\-/, '') | |
| 77 | + dt['id'] ||= node['id'].remove(/\w+\-/) | |
| 78 | 78 | end |
| 79 | 79 | node.remove |
| 80 | 80 | end |