mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import RDoc 2.2.1 r185
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
00b4a3f9c4
commit
858362e761
54 changed files with 2893 additions and 2268 deletions
|
@ -57,7 +57,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||
|
||||
##
|
||||
# Generate a hyperlink for url, labeled with text. Handle the
|
||||
# special cases for img: and link: described under handle_special_HYPEDLINK
|
||||
# special cases for img: and link: described under handle_special_HYPERLINK
|
||||
|
||||
def gen_url(url, text)
|
||||
if url =~ /([A-Za-z]+):(.*)/ then
|
||||
|
@ -304,9 +304,12 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||
# some of these patterns are taken from SmartyPants...
|
||||
|
||||
def convert_string_fancy(item)
|
||||
# convert -- to em-dash, (-- to en-dash)
|
||||
item.gsub(/---?/, '—'). #gsub(/--/, '–').
|
||||
# convert ampersand before doing anything else
|
||||
item.gsub(/&/, '&').
|
||||
|
||||
# convert -- to em-dash, (-- to en-dash)
|
||||
gsub(/---?/, '—'). #gsub(/--/, '–').
|
||||
|
||||
# convert ... to elipsis (and make sure .... becomes .<elipsis>)
|
||||
gsub(/\.\.\.\./, '.…').gsub(/\.\.\./, '…').
|
||||
|
||||
|
@ -318,15 +321,15 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||
gsub(/'/, '‘').
|
||||
|
||||
# convert double closing quote
|
||||
gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}, '\1”'). # }
|
||||
gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}, '\1”'). # }
|
||||
|
||||
# convert double opening quote
|
||||
gsub(/'/, '“').
|
||||
gsub(/"/, '“').
|
||||
|
||||
# convert copyright
|
||||
gsub(/\(c\)/, '©').
|
||||
|
||||
# convert and registered trademark
|
||||
# convert registered trademark
|
||||
gsub(/\(r\)/, '®')
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue