Skip to content

Commit 8ef486b

Browse files
committed
Loosen TIDYLINK regexp to work with rdoc-ref
1 parent 0d64bd5 commit 8ef486b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

History.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
=== 3.9.1 / ??
1+
=== 3.9.2 / 2011-08-11
2+
3+
* Bug fix
4+
* Loosened TIDYLINK regexp to allow any content in the link section like:
5+
<tt>{foo}[rdoc-ref:SomeClass]</tt>
6+
7+
=== 3.9.1 / 2011-07-31
28

39
* Bug fixes
410
* Fix RDoc::Markup parser for a header followed by a non-text token. Issue

lib/rdoc/markup/to_html.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def initialize markup = nil
7474
@markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
7575

7676
# and links of the form <text>[<url>]
77-
@markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
77+
@markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\])/, :TIDYLINK)
7878

7979
init_tags
8080
end

test/test_rdoc_markup_to_html_crossref.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ def test_convert_HYPERLINK_rdoc_ref
2525
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
2626
end
2727

28+
def test_convert_TIDYLINK_rdoc_ref
29+
result = @to.convert '{foo}[rdoc-ref:C1]'
30+
31+
assert_equal "\n<p><a href=\"C1.html\">foo</a></p>\n", result
32+
end
33+
2834
def test_gen_url
2935
assert_equal '<a href="C1.html">Some class</a>',
3036
@to.gen_url('rdoc-ref:C1', 'Some class')

0 commit comments

Comments
 (0)