mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 05:55:46 +02:00
[ruby/rdoc] Enable cross reference in code
(https://github.com/ruby/rdoc/pull/1240)
Some people like to mark up method names in MarkDown style block
quotes, like this: ruby/ruby#12333.
Currently, no links are created in the code in the RDoc, but such
words most likely refer to methods.
This PR makes a word a code cross-reference if the whole word can be
resolved as a reference.
7d7efb0709
This commit is contained in:
parent
375fec7c53
commit
fef8ecc708
3 changed files with 70 additions and 12 deletions
|
@ -16,6 +16,18 @@ class RDocMarkupToHtmlCrossrefTest < XrefTestCase
|
|||
result = @to.convert 'C1'
|
||||
|
||||
assert_equal para("<a href=\"C1.html\"><code>C1</code></a>"), result
|
||||
|
||||
result = @to.convert '+C1+'
|
||||
assert_equal para("<a href=\"C1.html\"><code>C1</code></a>"), result
|
||||
|
||||
result = @to.convert 'FOO'
|
||||
assert_equal para("FOO"), result
|
||||
|
||||
result = @to.convert '+FOO+'
|
||||
assert_equal para("<code>FOO</code>"), result
|
||||
|
||||
result = @to.convert '<tt># :stopdoc:</tt>:'
|
||||
assert_equal para("<code># :stopdoc:</code>:"), result
|
||||
end
|
||||
|
||||
def test_convert_CROSSREF_method
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue