mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Correct parser to ignore escaped quotes when not in quotes already
Related to #8481
This commit is contained in:
@@ -26,9 +26,9 @@ def _get_quote_state(token, quote_char):
|
||||
for idx, cur_char in enumerate(token):
|
||||
if idx > 0:
|
||||
prev_char = token[idx-1]
|
||||
if cur_char in '"\'':
|
||||
if cur_char in '"\'' and prev_char != '\\':
|
||||
if quote_char:
|
||||
if cur_char == quote_char and prev_char != '\\':
|
||||
if cur_char == quote_char:
|
||||
quote_char = None
|
||||
else:
|
||||
quote_char = cur_char
|
||||
|
||||
Reference in New Issue
Block a user