From beee26ec3a24d880c785b454f5448d0748d800f9 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 2 Oct 2025 22:58:32 +0200 Subject: [PATCH] Fix tests crashing on empty lines in anchored regions. --- src/ircplom/testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index c8bfdd6..fca3765 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -144,9 +144,9 @@ class _Playbook: if len(range_data) == 2: return inserts for jdx, insert in enumerate(inserts): - context, msg = self._split_by_context_separator(insert) - if context == _CHAR_ANCHOR: + if (not insert) or insert.startswith(_CHAR_ANCHOR): continue + context, msg = self._split_by_context_separator(insert) inserts[jdx] = _CHAR_CONTEXT_SEP.join([range_data[2]] + [msg]) return inserts -- 2.30.2