diff --git a/changelog/current.md b/changelog/current.md index e37f81b8..0a4ac454 100644 --- a/changelog/current.md +++ b/changelog/current.md @@ -7,6 +7,7 @@ - The emit implementation logic was refactored, and is now significantly cleaner - Emitted YAML will now have anchors emitted before tags, as is customary ([see example](https://play.yaml.io/main/parser?input=LSAhdGFnICZhbmNob3IgfAogIG5vdGUgaG93IHRoZSBhbmNob3IgY29tZXMKICBmaXJzdCBpbiB0aGUgZXZlbnRz)). - Added `ParserOptions` defaulted argument to temp-parser overloads of `parse_{yaml,json}_in_{place,arena}()` + - [PR#567](https://github.com/biojppm/rapidyaml/pull/567) (fixes [#566](https://github.com/biojppm/rapidyaml/issues/566)) fixes a regression from this refactor where top-level container anchors were wrongly emitted in the same line if no style was set on the container. ### API changes diff --git a/src/c4/yml/emit.def.hpp b/src/c4/yml/emit.def.hpp index 52c0b1a9..5b6bc5ce 100644 --- a/src/c4/yml/emit.def.hpp +++ b/src/c4/yml/emit.def.hpp @@ -314,7 +314,7 @@ void Emitter::_top_open_entry(id_type node) else { _RYML_ASSERT_VISIT_(m_tree->callbacks(), ty.is_container(), m_tree, node); - if(ty.is_block()) + if(!ty.is_flow()) _pend_newl(); } }