mirror of
https://github.com/redmine/redmine.git
synced 2026-01-30 03:09:58 +01:00
Fix RuboCop offense Style/RedundantRegexpArgument (#36919).
git-svn-id: https://svn.redmine.org/redmine/trunk@22262 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -364,7 +364,7 @@ module Redmine
|
||||
end
|
||||
|
||||
def normalize_cvs_path(path)
|
||||
normalize_path(path.gsub(/Attic\//,''))
|
||||
normalize_path(path.gsub("Attic/",''))
|
||||
end
|
||||
|
||||
def normalize_path(path)
|
||||
|
||||
@@ -24,9 +24,9 @@ module Redmine
|
||||
|
||||
def shell_quote(str)
|
||||
if Redmine::Platform.mswin?
|
||||
'"' + str.gsub(/"/, '\\"') + '"'
|
||||
'"' + str.gsub('"', '\\"') + '"'
|
||||
else
|
||||
"'" + str.gsub(/'/, "'\"'\"'") + "'"
|
||||
"'" + str.gsub("'", "'\"'\"'") + "'"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ module Redmine
|
||||
# original language for extension development
|
||||
langattr = " data-language=\"#{CGI.escapeHTML language}\"" if language.present?
|
||||
if Redmine::SyntaxHighlighting.language_supported?(language)
|
||||
text.gsub!(/x%x%/, '&')
|
||||
text.gsub!("x%x%", '&')
|
||||
content = "<code class=\"#{CGI.escapeHTML language} syntaxhl\"#{langattr}>" +
|
||||
Redmine::SyntaxHighlighting.highlight_by_language(text, language)
|
||||
else
|
||||
|
||||
@@ -313,7 +313,7 @@ class RedCloth3 < String
|
||||
retrieve text
|
||||
|
||||
text.gsub!( /<\/?notextile>/, '' )
|
||||
text.gsub!( /x%x%/, '&' )
|
||||
text.gsub!( "x%x%", '&' )
|
||||
clean_html text if filter_html
|
||||
text.strip!
|
||||
text
|
||||
@@ -1016,9 +1016,9 @@ class RedCloth3 < String
|
||||
|
||||
def clean_white_space( text )
|
||||
# normalize line breaks
|
||||
text.gsub!( /\r\n/, "\n" )
|
||||
text.gsub!( "\r\n", "\n" )
|
||||
text.tr!( "\r", "\n" )
|
||||
text.gsub!( /\t/, ' ' )
|
||||
text.gsub!( "\t", ' ' )
|
||||
text.gsub!( /^ +$/, '' )
|
||||
text.gsub!( /\n{3,}/, "\n\n" )
|
||||
text.gsub!( /"$/, "\" " )
|
||||
@@ -1184,7 +1184,7 @@ class RedCloth3 < String
|
||||
}
|
||||
|
||||
def clean_html( text, tags = BASIC_TAGS )
|
||||
text.gsub!( /<!\[CDATA\[/, '' )
|
||||
text.gsub!( "<![CDATA[", '' )
|
||||
text.gsub!( /<(\/*)(\w+)([^>]*)>/ ) do
|
||||
raw = $~
|
||||
tag = raw[2].downcase
|
||||
|
||||
Reference in New Issue
Block a user