Sort matches before replacment on post process

This commit is contained in:
Dazzy Ding 2017-02-18 19:41:53 +08:00
parent 77a8fbab60
commit 6e769bd62c
1 changed files with 1 additions and 0 deletions

View File

@ -90,6 +90,7 @@ class PrettyJsonBaseCommand:
if post_process:
# find all array matches
matches = re.findall(r"\[([^\[\]]+?)\]", output_json)
matches.sort(key=len, reverse=True)
join_separator = line_separator.ljust(2)
for m in matches:
items = [a.strip() for a in m.split(line_separator.strip())]