Skip to content

Commit

Permalink
Fix #204 triple quote detection incorrect on non stipped line
Browse files Browse the repository at this point in the history
triple quote """ or ''' ending a multiline string are not checked
correctly if line ends with comments or spacing or anything
  • Loading branch information
rudy-6-4 committed May 5, 2020
1 parent f4f0b84 commit 1dcf56b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion toml/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,17 @@ def loads(s, _dict=dict, decoder=None):

decoder.embed_comments(idx, currentlevel)

stripped_line = line.strip()
if not multilinestr or multibackslash or '\n' not in multilinestr:
line = line.strip()
line = stripped_line
if line == "" and (not multikey or multibackslash):
continue
if multikey:
if multibackslash:
multilinestr += line
else:
multilinestr += line
line = stripped_line
multibackslash = False
closed = False
if multilinestr[0] == '[':
Expand Down

0 comments on commit 1dcf56b

Please sign in to comment.