diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8daaec7ba..fed9e59e5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1105,10 +1105,6 @@ Style/IfUnlessModifierOfIfUnless: Exclude: - 'app/models/attachment.rb' -Style/IfWithSemicolon: - Exclude: - - 'lib/redmine/wiki_formatting/textile/redcloth3.rb' - # Cop supports --auto-correct. # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: diff --git a/lib/redmine/wiki_formatting/textile/redcloth3.rb b/lib/redmine/wiki_formatting/textile/redcloth3.rb index 300afdc11..d68c3a264 100644 --- a/lib/redmine/wiki_formatting/textile/redcloth3.rb +++ b/lib/redmine/wiki_formatting/textile/redcloth3.rb @@ -739,7 +739,7 @@ class RedCloth3 < String SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m def block_markdown_setext( text ) if text =~ SETEXT_RE - tag = if $2 == "="; "h1"; else; "h2"; end + tag = ($2 == "=" ? "h1" : "h2") blk, cont = "<#{ tag }>#{ $1 }", $' blocks cont text.replace( blk + cont )