Creates HTML-safe labels suitable for use in id attributes. Tidylinks are converted to their link part and cross-reference links have the suppression marks removed (\SomeClass is converted to SomeClass).
Methods
Class Public methods
new(markup = nil)
Link
Creates a new formatter that will output HTML-safe labels
Source: show
# File lib/rdoc/markup/to_label.rb, line 15 def initialize markup = nil super nil, markup @markup.add_special RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\])/, :TIDYLINK) add_tag :BOLD, '', '' add_tag :TT, '', '' add_tag :EM, '', '' @res = [] end
Instance Public methods
convert(text)
Link
Converts text to an HTML-safe label
Source: show
# File lib/rdoc/markup/to_label.rb, line 31 def convert text label = convert_flow @am.flow text CGI.escape label end