mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-07 22:35:37 +00:00
Two comment-fidelity bugs in the TOML round-trip: - A head comment directly above an [[array-of-tables]] header was dropped. The decoder attaches it correctly, but the three encoder loops that emit [[...]] headers never wrote it, unlike the [table] path. Emit each element's head comment before its header. - An inline (trailing) comment on an array item detached and floated onto its own line as a head comment on the next item, with a spurious blank line. createArray treated every in-array comment as a head comment for the next element; use the parser's byte ranges to detect a same-line trailing comment and attach it as a line comment on the current item instead. The encoder now emits array-item line comments inline and only inserts a blank line before head-commented elements. Adds round-trip tests for both cases. |
||
|---|---|---|
| .. | ||
| yqlib | ||