method
convert_string
v1_8_7_330 -
Show latest stable
- Class:
SM::ToHtml
convert_string(item)private
some of these patterns are taken from SmartyPants…
# File lib/rdoc/markup/simple_markup/to_html.rb, line 190
def convert_string(item)
CGI.escapeHTML(item).
# convert -- to em-dash, (-- to en-dash)
gsub(/---?/, '—'). #gsub(/--/, '–').
# convert ... to elipsis (and make sure .... becomes .<elipsis>)
gsub(/\.\.\.\./, '.…').gsub(/\.\.\./, '…').
# convert single closing quote
gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1’" }.
gsub(%r{\'(?=\W|s\b)}) { "’" }.
# convert single opening quote
gsub(/'/, '‘').
# convert double closing quote
gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}) { "#$1”" }.
# convert double opening quote
gsub(/'/, '“').
# convert copyright
gsub(/\(c\)/, '©').
# convert and registered trademark
gsub(/\(r\)/, '®')
end Related methods
- Instance methods
- accept_blank_line
- accept_heading
- accept_list_end
- accept_list_item
- accept_list_start
- accept_paragraph
- accept_rule
- accept_verbatim
- add_tag
- annotate
- end_accepting
- init_tags
- start_accepting
- wrap
- Class methods
- new
- Private methods
-
convert_flow -
convert_heading -
convert_special -
convert_string -
html_list_name -
list_end_for -
list_item_start -
off_tags -
on_tags