1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

tighten up line test logic when counting tabs

This commit is contained in:
Kelly Brazil
2020-05-14 09:58:16 -07:00
parent 7138dd02b7
commit 1cfcc2b592

View File

@ -274,6 +274,7 @@ def parse(data, raw=False, quiet=False):
if item_values \ if item_values \
and len(line.split(':', maxsplit=1)) == 2 \ and len(line.split(':', maxsplit=1)) == 2 \
and line.startswith('\t') \ and line.startswith('\t') \
and not line.startswith('\t\t') \
and not line.strip().endswith(':'): and not line.strip().endswith(':'):
item_header = False item_header = False
item_values = True item_values = True
@ -294,6 +295,7 @@ def parse(data, raw=False, quiet=False):
# multi-line key # multi-line key
if item_values \ if item_values \
and line.startswith('\t') \ and line.startswith('\t') \
and not line.startswith('\t\t') \
and line.strip().endswith(':'): and line.strip().endswith(':'):
item_header = False item_header = False
item_values = True item_values = True