Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2_2_9) is shown here.
convert_attrs(str, attrs)
public
Map attributes like textto the sequence
001002<char>001003<char>, where <char> is a per-attribute
specific character
# File lib/rdoc/markup/attribute_manager.rb, line 129
def convert_attrs(str, attrs)
# first do matching ones
tags = @matching_word_pairs.keys.join("")
re = /(^|\W)([#{tags}])([#\\]?[\w:.\/-]+?\S?)\22((\W|$)/
1 while str.gsub!(re) do
attr = @matching_word_pairs[$2]
attrs.set_attrs($`.length + $1.length + $2.length, $3.length, attr)
$1 + NULL * $2.length + $3 + NULL * $2.length + $4
end
# then non-matching
unless @word_pair_map.empty? then
@word_pair_map.each do |regexp, attr|
str.gsub!(regexp) {
attrs.set_attrs($`.length + $1.length, $2.length, attr)
NULL * $1.length + $2 + NULL * $3.length
}
end
end
end