From 87438e5858ea7d68713157604da036af0f4a6ba6 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Tue, 21 Sep 2021 10:24:28 -0500 Subject: [PATCH] make _set_text_field work properly when 1 line long OBO error resulted in the new text getting appended rather than replacing the existing text in this case. --- tzk/builders.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tzk/builders.py b/tzk/builders.py index 000d682..1cb7936 100644 --- a/tzk/builders.py +++ b/tzk/builders.py @@ -461,7 +461,7 @@ def _set_text_field(mappings: Dict[str, str]) -> None: def editor(tiddler_path: Path, tiddler_lines: Sequence[str], new_text: str) -> None: if not str(tiddler_path).endswith('.tid'): # will be a separate meta file, so the whole thing is the text field - first_blank_line_index = 0 + first_blank_line_index = -1 else: first_blank_line_index = next(idx for idx, value in enumerate(tiddler_lines)