Skip to content

Commit

Permalink
Fix TIDYLINK after braces (#1015)
Browse files Browse the repository at this point in the history
TIDYLINK multi-word label should not include braces.
  • Loading branch information
nobu committed Nov 14, 2023
1 parent 3d3862a commit 41ad319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rdoc/markup/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def add_regexp_handling_RDOCLINK

def add_regexp_handling_TIDYLINK
@markup.add_regexp_handling(/(?:
\{.*?\} | # multi-word label
\{[^{}]*\} | # multi-word label
\b[^\s{}]+? # single-word label
)
Expand Down
6 changes: 6 additions & 0 deletions test/rdoc/test_rdoc_markup_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ def @to.handle_regexp_TIDYLINK target
formatted = document.accept @to

assert_equal '<{foo}[rdoc-label:bar]>.', formatted

document = doc(para('<tt>{abc}</tt>: {foo}[rdoc-label:bar].'))

formatted = document.accept @to

assert_equal '<code>{abc}</code>: <{foo}[rdoc-label:bar]>.', formatted
end

def test_parse_url
Expand Down

0 comments on commit 41ad319

Please sign in to comment.