Skip to content

Commit 41ad319

Browse files
committed
Fix TIDYLINK after braces (#1015)
TIDYLINK multi-word label should not include braces.
1 parent 3d3862a commit 41ad319

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/rdoc/markup/formatter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def add_regexp_handling_RDOCLINK
9090

9191
def add_regexp_handling_TIDYLINK
9292
@markup.add_regexp_handling(/(?:
93-
\{.*?\} | # multi-word label
93+
\{[^{}]*\} | # multi-word label
9494
\b[^\s{}]+? # single-word label
9595
)
9696

test/rdoc/test_rdoc_markup_formatter.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ def @to.handle_regexp_TIDYLINK target
104104
formatted = document.accept @to
105105

106106
assert_equal '<{foo}[rdoc-label:bar]>.', formatted
107+
108+
document = doc(para('<tt>{abc}</tt>: {foo}[rdoc-label:bar].'))
109+
110+
formatted = document.accept @to
111+
112+
assert_equal '<code>{abc}</code>: <{foo}[rdoc-label:bar]>.', formatted
107113
end
108114

109115
def test_parse_url

0 commit comments

Comments
 (0)