You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Style/StringConcatenation is autocorrecting a "complex" string concatenation into a string that is incorrect.
%(You need to read this! This is very important. ) +
%(<a target="_blank" rel="noopener noreferrer" id="body-redirect-link" ) +
%(href="https://www.domain.com/article.html">read more</a>)
is being autocorrected to (note the unscoped " inside the string)
"You need to read this! This is very important. <a target="_blank" rel="noopener noreferrer" id="body-redirect-link" href="https://www.domain.com/article.html">read more</a>"
These are the additional errors after the autocorrection:
wrong.rb:3:60: E: Lint/Syntax: unexpected token tIDENTIFIER
(Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
"You need to read this! This is very important. <a target="_blank" rel="noopener noreferrer" id="body-redirect-link" href="https://www.domain.com/article.html">read more</a>"
^^^^^^
wrong.rb:3:98: E: Lint/Syntax: unexpected token tIDENTIFIER
(Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
"You need to read this! This is very important. <a target="_blank" rel="noopener noreferrer" id="body-redirect-link" href="https://www.domain.com/article.html">read more</a>"
^^^^
wrong.rb:3:116: E: Lint/Syntax: unexpected token tSTRING
(Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
"You need to read this! This is very important. <a target="_blank" rel="noopener noreferrer" id="body-redirect-link" href="https://www.domain.com/article.html">read more</a>"
^^^^^^^^
wrong.rb:3:160: E: Lint/Syntax: unexpected token tSTRING
(Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
"You need to read this! This is very important. <a target="_blank" rel="noopener noreferrer" id="body-redirect-link" href="https://www.domain.com/article.html">read more</a>"
^^^^^^^^^^^^^^^^
Expected behavior
Running rubocop -A should correct a concatenated string in a way that does not lead to a broken string.
The
Style/StringConcatenation
is autocorrecting a "complex" string concatenation into a string that is incorrect.is being autocorrected to (note the unscoped
"
inside the string)These are the additional errors after the autocorrection:
Expected behavior
Running
rubocop -A
should correct a concatenated string in a way that does not lead to a broken string.Actual behavior
Resulting string is wrong.
Steps to reproduce the problem
see above
RuboCop version
The text was updated successfully, but these errors were encountered: