@@ -53,10 +53,10 @@ class RDoc::Markup::AttributeManager
53
53
attr_reader :protectable
54
54
55
55
##
56
- # And this maps _special_ sequences to a name. A special sequence is
57
- # something like a WikiWord
56
+ # And this maps _regexp handling_ sequences to a name. A regexp handling
57
+ # sequence is something like a WikiWord
58
58
59
- attr_reader :special
59
+ attr_reader :regexp_handlings
60
60
61
61
##
62
62
# Creates a new attribute manager that understands bold, emphasized and
@@ -66,7 +66,7 @@ def initialize
66
66
@html_tags = { }
67
67
@matching_word_pairs = { }
68
68
@protectable = %w[ < ]
69
- @special = [ ]
69
+ @regexp_handlings = [ ]
70
70
@word_pair_map = { }
71
71
@attributes = RDoc ::Markup ::Attributes . new
72
72
@@ -166,22 +166,22 @@ def convert_html(str, attrs)
166
166
end
167
167
168
168
##
169
- # Converts special sequences to RDoc attributes
169
+ # Converts regexp handling sequences to RDoc attributes
170
170
171
- def convert_specials str , attrs
172
- @special . each do |regexp , attribute |
171
+ def convert_regexp_handlings str , attrs
172
+ @regexp_handlings . each do |regexp , attribute |
173
173
str . scan ( regexp ) do
174
174
capture = $~. size == 1 ? 0 : 1
175
175
176
176
s , e = $~. offset capture
177
177
178
- attrs . set_attrs s , e - s , attribute | @attributes . special
178
+ attrs . set_attrs s , e - s , attribute | @attributes . regexp_handling
179
179
end
180
180
end
181
181
end
182
182
183
183
##
184
- # Escapes special sequences of text to prevent conversion to RDoc
184
+ # Escapes regexp handling sequences of text to prevent conversion to RDoc
185
185
186
186
def mask_protected_sequences
187
187
# protect __send__, __FILE__, etc.
@@ -193,7 +193,7 @@ def mask_protected_sequences
193
193
end
194
194
195
195
##
196
- # Unescapes special sequences of text
196
+ # Unescapes regexp handling sequences of text
197
197
198
198
def unmask_protected_sequences
199
199
@str . gsub! ( /(.)#{ PROTECT_ATTR } / , "\\ 1\000 " )
@@ -233,17 +233,17 @@ def add_html(tag, name)
233
233
end
234
234
235
235
##
236
- # Adds a special handler for +pattern+ with +name+. A simple URL handler
236
+ # Adds a regexp handling for +pattern+ with +name+. A simple URL handler
237
237
# would be:
238
238
#
239
- # @am.add_special (/((https?:)\S+\w)/, :HYPERLINK)
239
+ # @am.add_regexp_handling (/((https?:)\S+\w)/, :HYPERLINK)
240
240
241
- def add_special pattern , name
242
- @special << [ pattern , @attributes . bitmap_for ( name ) ]
241
+ def add_regexp_handling pattern , name
242
+ @regexp_handlings << [ pattern , @attributes . bitmap_for ( name ) ]
243
243
end
244
244
245
245
##
246
- # Processes +str+ converting attributes, HTML and specials
246
+ # Processes +str+ converting attributes, HTML and regexp handlings
247
247
248
248
def flow str
249
249
@str = str . dup
@@ -252,9 +252,9 @@ def flow str
252
252
253
253
@attrs = RDoc ::Markup ::AttrSpan . new @str . length
254
254
255
- convert_attrs @str , @attrs
256
- convert_html @str , @attrs
257
- convert_specials @str , @attrs
255
+ convert_attrs @str , @attrs
256
+ convert_html @str , @attrs
257
+ convert_regexp_handlings @str , @attrs
258
258
259
259
unmask_protected_sequences
260
260
@@ -312,12 +312,12 @@ def split_into_flow
312
312
res << change_attribute ( current_attr , new_attr )
313
313
current_attr = new_attr
314
314
315
- if ( current_attr & @attributes . special ) != 0 then
315
+ if ( current_attr & @attributes . regexp_handling ) != 0 then
316
316
i += 1 while
317
- i < str_len and ( @attrs [ i ] & @attributes . special ) != 0
317
+ i < str_len and ( @attrs [ i ] & @attributes . regexp_handling ) != 0
318
318
319
- res << RDoc ::Markup ::Special . new ( current_attr ,
320
- copy_string ( start_pos , i ) )
319
+ res << RDoc ::Markup ::RegexpHandling . new ( current_attr ,
320
+ copy_string ( start_pos , i ) )
321
321
start_pos = i
322
322
next
323
323
end
0 commit comments