File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 99### Fixed
1010
1111- Fix non-existing key error when deleting an item from an out-of-order table. ([ #383 ] ( https://github.com/python-poetry/tomlkit/issues/383 ) )
12+ - Ensure newline is added between the plain values and the first table. ([ #387 ] ( https://github.com/python-poetry/tomlkit/issues/387 ) )
1213- Fix repeated whitespace when removing an array item. ([ #405 ] ( https://github.com/python-poetry/tomlkit/issues/405 ) )
1314- Fix invalid serialization after removing array item if the comma is on its own line. ([ #408 ] ( https://github.com/python-poetry/tomlkit/issues/408 ) )
1415- Fix serialization of a nested dotted key table. ([ #411 ] ( https://github.com/python-poetry/tomlkit/issues/411 ) )
Original file line number Diff line number Diff line change @@ -692,6 +692,7 @@ def test_update_nested_out_of_order_table():
692692 == """\
693693 [root1.root2.a]
694694tmp = "hi"
695+
695696[root1.root2.a.b.c]
696697 value = 2
697698[WALRUS]
@@ -814,6 +815,7 @@ def test_replace_table_with_value():
814815 assert (
815816 doc .as_string ()
816817 == """bar = 42
818+
817819[foo]
818820a = 1
819821
Original file line number Diff line number Diff line change @@ -289,6 +289,12 @@ def append(
289289 last_index = self ._get_last_index_before_table ()
290290
291291 if last_index < len (self ._body ):
292+ after_item = self ._body [last_index ][1 ]
293+ if not (
294+ isinstance (after_item , Whitespace )
295+ or "\n " in after_item .trivia .indent
296+ ):
297+ after_item .trivia .indent = "\n " + after_item .trivia .indent
292298 return self ._insert_at (last_index , key , item )
293299 else :
294300 previous_item = self ._body [- 1 ][1 ]
You can’t perform that action at this time.
0 commit comments