aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-03-16 19:01:50 +0900
committeraycabta <aycabta@gmail.com>2021-04-03 01:21:50 +0900
commit61e1cf23ac0d122fba3ad4cbaa402c7c94ad54d3 (patch)
tree7c4d65e6545f38c7c9db408d21ec2d23de50b115 /lib/rdoc
parente84d275fe6d0c14ba58ce73b13323879c060b7ae (diff)
downloadruby-61e1cf23ac0d122fba3ad4cbaa402c7c94ad54d3.tar.gz
[ruby/rdoc] Treat emphasis tags as excluding other notations
And exclusive notations don't exclude other exclusive notations. https://github.com/ruby/rdoc/commit/b8baa9a435
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/markup/attr_span.rb2
-rw-r--r--lib/rdoc/markup/attribute_manager.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/rdoc/markup/attr_span.rb b/lib/rdoc/markup/attr_span.rb
index 6fe939fe7d..20ef11cd6d 100644
--- a/lib/rdoc/markup/attr_span.rb
+++ b/lib/rdoc/markup/attr_span.rb
@@ -17,7 +17,7 @@ class RDoc::Markup::AttrSpan
def set_attrs(start, length, bits)
updated = false
for i in start ... (start+length)
- if (@exclusive & @attrs[i]) == 0
+ if (@exclusive & @attrs[i]) == 0 || (@exclusive & bits) != 0
@attrs[i] |= bits
updated = true
end
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb
index 2de8a7c9ee..50764510f3 100644
--- a/lib/rdoc/markup/attribute_manager.rb
+++ b/lib/rdoc/markup/attribute_manager.rb
@@ -75,13 +75,13 @@ class RDoc::Markup::AttributeManager
@exclusive_bitmap = 0
@attributes = RDoc::Markup::Attributes.new
- add_word_pair "*", "*", :BOLD
- add_word_pair "_", "_", :EM
+ add_word_pair "*", "*", :BOLD, true
+ add_word_pair "_", "_", :EM, true
add_word_pair "+", "+", :TT, true
- add_html "em", :EM
- add_html "i", :EM
- add_html "b", :BOLD
+ add_html "em", :EM, true
+ add_html "i", :EM, true
+ add_html "b", :BOLD, true
add_html "tt", :TT, true
add_html "code", :TT, true
end