-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDoc does not provide syntax to style manual code ref links with `<code></code>`. Wrapping code ref links in `<tt></tt>` or `++` does not give the desired result. For example, ```ruby # {<tt>Rails</tt>}[rdoc-ref:Rails] ``` is rendered as ```html {<code>Rails</code><a href="..."><code>}</code></a> ``` and ```ruby # <tt>{Rails}[rdoc-ref:Rails]</tt> ``` is rendered as ```html <code>{Rails}[rdoc-ref:Rails]</code> ``` This commit uses postprocessing to style unstyled code ref links that look like code. If the link text does not contain a space or if it matches `/\S\(/` (e.g. `foo(bar, &block)`), it is assumed to be code, and the text is then wrapped with `<code></code>`. This complements 4837fea in that it allows manual code ref links to single-word modules to be styled as if they were autolinks.
- Loading branch information
1 parent
ef39d46
commit 845aa5d
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters