Skip to content

Commit 65f6507

Browse files
committed
Don't fail .strings parsing upon an escaped character in inline comment
1 parent dca9d29 commit 65f6507

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/strings_file_validation_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def self.get_keys_from_strings(file:)
7979
if state.in_escaped_ctx || c == '\\'
8080
# Just because we check for escaped characters at the global
8181
# level, it doesn't mean we allow them in every context.
82-
raise "Found escaped character outside of allowed contexts on line #{line_no + 1} (current context: #{state.context})" unless %i[in_quoted_key in_quoted_value in_block_comment].include?(state.context)
82+
allowed_contexts_for_escaped_characters = %i[in_quoted_key in_quoted_value in_block_comment in_line_comment]
83+
raise "Found escaped character outside of allowed contexts on line #{line_no + 1} (current context: #{state.context})" unless allowed_contexts_for_escaped_characters.include?(state.context)
8384

8485
state.buffer.write(c) if state.context == :in_quoted_key
8586
state.in_escaped_ctx = !state.in_escaped_ctx

0 commit comments

Comments
 (0)