diff options
author | aycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 06:28:20 +0000 |
---|---|---|
committer | aycabta <aycabta@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 06:28:20 +0000 |
commit | 1b43644edc85a93bfc9228588c065c87f975cd93 (patch) | |
tree | ef3a60d0cbe73d15b39f6160853df9a23239a574 /lib/rdoc/markup/to_label.rb | |
parent | 2a59b579fed2fd49973ca73890f182299262909f (diff) |
Merge rdoc-6.1.0.beta2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup/to_label.rb')
-rw-r--r-- | lib/rdoc/markup/to_label.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/rdoc/markup/to_label.rb b/lib/rdoc/markup/to_label.rb index 9f179013f2..3d95ccc2e2 100644 --- a/lib/rdoc/markup/to_label.rb +++ b/lib/rdoc/markup/to_label.rb @@ -16,8 +16,8 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter def initialize markup = nil super nil, markup - @markup.add_special RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF - @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\])/, :TIDYLINK) + @markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF + @markup.add_regexp_handling(/(((\{.*?\})|\b\S+?)\[\S+?\])/, :TIDYLINK) add_tag :BOLD, '', '' add_tag :TT, '', '' @@ -36,20 +36,20 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter end ## - # Converts the CROSSREF +special+ to plain text, removing the suppression + # Converts the CROSSREF +target+ to plain text, removing the suppression # marker, if any - def handle_special_CROSSREF special - text = special.text + def handle_regexp_CROSSREF target + text = target.text text.sub(/^\\/, '') end ## - # Converts the TIDYLINK +special+ to just the text part + # Converts the TIDYLINK +target+ to just the text part - def handle_special_TIDYLINK special - text = special.text + def handle_regexp_TIDYLINK target + text = target.text return text unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/ @@ -68,7 +68,7 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter alias accept_rule ignore alias accept_verbatim ignore alias end_accepting ignore - alias handle_special_HARD_BREAK ignore + alias handle_regexp_HARD_BREAK ignore alias start_accepting ignore end |