summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup/attr_span.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/markup/attr_span.rb')
-rw-r--r--lib/rdoc/markup/attr_span.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rdoc/markup/attr_span.rb b/lib/rdoc/markup/attr_span.rb
index 63aace60d2..20ef11cd6d 100644
--- a/lib/rdoc/markup/attr_span.rb
+++ b/lib/rdoc/markup/attr_span.rb
@@ -7,16 +7,22 @@ class RDoc::Markup::AttrSpan
##
# Creates a new AttrSpan for +length+ characters
- def initialize(length)
+ def initialize(length, exclusive)
@attrs = Array.new(length, 0)
+ @exclusive = exclusive
end
##
# Toggles +bits+ from +start+ to +length+
def set_attrs(start, length, bits)
+ updated = false
for i in start ... (start+length)
- @attrs[i] |= bits
+ if (@exclusive & @attrs[i]) == 0 || (@exclusive & bits) != 0
+ @attrs[i] |= bits
+ updated = true
+ end
end
+ updated
end
##