Method: RDoc::Markup::AttributeManager#convert_attrs_word_pair_map

Defined in:
lib/rdoc/markup/attribute_manager.rb

#convert_attrs_word_pair_map(str, attrs, exclusive) ⇒ Object

:nodoc:



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/rdoc/markup/attribute_manager.rb', line 185

def convert_attrs_word_pair_map(str, attrs, exclusive)
  # then non-matching
  unless @word_pair_map.empty? then
    @word_pair_map.each do |regexp, attr|
      next unless exclusive == exclusive?(attr)
      1 while str.gsub!(regexp) { |orig|
        w = (m = ($~))[2]
        updated = attrs.set_attrs(m.begin(2), w.length, attr)
        if updated
          NULL * m.match_length(1) + w + NULL * m.match_length(3)
        else
          orig
        end
      }
    end
  end
end