3 Commits

Author SHA1 Message Date
Manuel Rüger
4c81c81fb3 fix: return original match on error in macro Apply()
Two bugs in the ReplaceAllFunc callback:
1. After yaml.Unmarshal failure, execution continued into Execute(),
   which could succeed and overwrite err with nil, silently swallowing
   the unmarshal error and producing output with default (empty) config.
2. After any error, the callback returned buffer.Bytes() (empty or
   partial) instead of the original match, corrupting the document.

Return the original match bytes unchanged on either error so the
directive is preserved in output and the error is not lost.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-16 19:18:29 +01:00
Manuel Rüger
8d83ec00c0 chore: Switch to maintained yaml 2026-02-08 01:51:43 +01:00
Manuel Rüger
dc8842106b *: Reorganize code 2024-09-29 00:13:04 +02:00