mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 09:33:59 +02:00
[ruby/rdoc] Add autolink_excluded_words option to ignore
cross-references
(https://github.com/ruby/rdoc/pull/1259)
This config will be handy when the project name is the same as a class or
module name, which is often the case for most of the projects.
ce77f51f63
This commit is contained in:
parent
63b141ef21
commit
c0e2623966
4 changed files with 38 additions and 2 deletions
|
@ -20,6 +20,9 @@ class RDocMarkupToHtmlCrossrefTest < XrefTestCase
|
|||
result = @to.convert '+C1+'
|
||||
assert_equal para("<a href=\"C1.html\"><code>C1</code></a>"), result
|
||||
|
||||
result = @to.convert 'Constant[rdoc-ref:C1]'
|
||||
assert_equal para("<a href=\"C1.html\">Constant</a>"), result
|
||||
|
||||
result = @to.convert 'FOO'
|
||||
assert_equal para("FOO"), result
|
||||
|
||||
|
@ -30,6 +33,20 @@ class RDocMarkupToHtmlCrossrefTest < XrefTestCase
|
|||
assert_equal para("<code># :stopdoc:</code>:"), result
|
||||
end
|
||||
|
||||
def test_convert_CROSSREF_ignored_excluded_words
|
||||
@options.autolink_excluded_words = ['C1']
|
||||
|
||||
result = @to.convert 'C1'
|
||||
assert_equal para("C1"), result
|
||||
|
||||
result = @to.convert '+C1+'
|
||||
assert_equal para("<a href=\"C1.html\"><code>C1</code></a>"), result
|
||||
|
||||
# Explicit linking with rdoc-ref is not ignored
|
||||
result = @to.convert 'Constant[rdoc-ref:C1]'
|
||||
assert_equal para("<a href=\"C1.html\">Constant</a>"), result
|
||||
end
|
||||
|
||||
def test_convert_CROSSREF_method
|
||||
result = @to.convert 'C1#m(foo, bar, baz)'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue