diff --git a/lib/rdoc/cross_reference.rb b/lib/rdoc/cross_reference.rb index 7b137483d5..76a4dcadee 100644 --- a/lib/rdoc/cross_reference.rb +++ b/lib/rdoc/cross_reference.rb @@ -28,7 +28,7 @@ class RDoc::CrossReference # have been suppressed, since the suppression characters are removed by the # code that is triggered. - CROSSREF_REGEXP = /(?:^|\s) + CROSSREF_REGEXP = /(?:^|[\s()]) ( (?: # A::B::C.meth diff --git a/test/rdoc/test_rdoc_markup_attribute_manager.rb b/test/rdoc/test_rdoc_markup_attribute_manager.rb index 024dcc18a1..a180666867 100644 --- a/test/rdoc/test_rdoc_markup_attribute_manager.rb +++ b/test/rdoc/test_rdoc_markup_attribute_manager.rb @@ -358,6 +358,8 @@ class TestRDocMarkupAttributeManager < RDoc::TestCase @am.flow("#fred dogs'")) assert_equal(["cats' ", crossref("#fred")].flatten, @am.flow("cats' #fred")) + + assert_equal(["(", crossref("#fred"), ")"].flatten, @am.flow("(#fred)")) end def test_tt_html