Subclass of the RDoc::Markup::ToHtml class that supports looking up words in the AllReferences list. Those that are found (like AllReferences in this comment) will be hyperlinked
Constants
CLASS_REGEXP_STR = '\\\\\\\\?((?:\\:{2})?[A-Z]\\w*(?:\\:\\:\\w+)*)'
CROSSREF_REGEXP = /(\n# A::B::C.meth\n#{CLASS_REGEXP_STR}[\\.\\#]#{METHOD_REGEXP_STR}\n\n# Stand-alone method (proceeded by a #)\n| \\\\?\\##{METHOD_REGEXP_STR}\n\n# A::B::C\n# The stuff after CLASS_REGEXP_STR is a\n# nasty hack. CLASS_REGEXP_STR unfortunately matches\n# words like dog and cat (these are legal "class"\n# names in Fortran 95). When a word is flagged as a\n# potential cross-reference, limitations in the markup\n# engine suppress other processing, such as typesetting.\n# This is particularly noticeable for contractions.\n# In order that words like "can't" not\n# be flagged as potential cross-references, only\n# flag potential class cross-references if the character\n# after the cross-referece is a space or sentence\n# punctuation.\n| #{CLASS_REGEXP_STR}(?=[\\s\\)\\.\\?\\!\\,\\;]|\\z)\n\n# Things that look like filenames\n# The key thing is that there must be at least\n# one special character (period, slash, or\n# underscore).\n| [\\/\\w]+[_\\/\\.][\\w\\/\\.]+\n\n# Things that have markup suppressed\n| \\\\[^\\s]\n)/x
METHOD_REGEXP_STR = '(\\w+[!?=]?)(?:\\([\\.\\w+\\*\\/\\+\\-\\=\\<\\>]*\\))?'
Attributes
| [RW] | context |
Files
- lib/rdoc/markup/to_html_crossref.rb