diff options
author | aycabta <[email protected]> | 2021-03-14 18:26:19 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2021-04-03 01:21:12 +0900 |
commit | 54aa11efa8b1be2c5d20402890d6d2fa90aa19a8 (patch) | |
tree | 8eb3e980e5ea244560337bec32ca1f8c87fdc7f6 /lib/rdoc/markup/attr_span.rb | |
parent | ab89c45b906380353d1b399781170cafe1d7b503 (diff) |
[ruby/rdoc] Disable other notations in <code> tags
https://github.com/ruby/rdoc/commit/0cd3b55210
Diffstat (limited to 'lib/rdoc/markup/attr_span.rb')
-rw-r--r-- | lib/rdoc/markup/attr_span.rb | 10 |
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..6fe939fe7d 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 + @attrs[i] |= bits + updated = true + end end + updated end ## |