From c82054a651daa253d5dd8778168067a79dc43a3c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 15 Oct 2019 11:48:37 +0000 Subject: [PATCH] code cleanup: rubocop: fix Style/IfWithSemicolon in lib/redmine/wiki_formatting/textile/redcloth3.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18680 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 4 ---- lib/redmine/wiki_formatting/textile/redcloth3.rb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) 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 )