diff --git a/toml/decoder.py b/toml/decoder.py index a24c04a..739f9a4 100644 --- a/toml/decoder.py +++ b/toml/decoder.py @@ -370,8 +370,9 @@ 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: @@ -379,6 +380,7 @@ def loads(s, _dict=dict, decoder=None): multilinestr += line else: multilinestr += line + line = stripped_line multibackslash = False closed = False if multilinestr[0] == '[':