mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/json/lib/json/pure/generator.rb,
ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb, ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb, lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb, lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb, lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb, lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb, lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb, lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb, lib/yaml/encoding.rb: performance tuning arround String#gsub. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
38694016bc
commit
40d8d38909
25 changed files with 71 additions and 58 deletions
|
@ -200,14 +200,14 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||
gsub(/\.\.\.\./, '.…').gsub(/\.\.\./, '…').
|
||||
|
||||
# convert single closing quote
|
||||
gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1’" }.
|
||||
gsub(%r{\'(?=\W|s\b)}) { "’" }.
|
||||
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”" }.
|
||||
gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}, '\1”').
|
||||
|
||||
# convert double opening quote
|
||||
gsub(/'/, '“').
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue