Skip to content

Commit

Permalink
Merge pull request #747 from nobu/bug/xref-methodname-in-paren
Browse files Browse the repository at this point in the history
Make `(#methodname)` a link
  • Loading branch information
aycabta authored Oct 26, 2019
2 parents 9d4c227 + e6fe351 commit 450fd05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdoc/cross_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/rdoc/test_rdoc_markup_attribute_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def test_regexp_handling
@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
Expand Down

0 comments on commit 450fd05

Please sign in to comment.