home · contact · privacy
Rather than remove them, turn into comment code-y lines from post-code gap fields...
authorChristian Heller <c.heller@plomlompom.de>
Sun, 27 Apr 2025 17:05:33 +0000 (19:05 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 27 Apr 2025 17:05:33 +0000 (19:05 +0200)
src/ledgplom/ledger.py

index 00db77da3afc87f9715fb9e5caf610b30f6af9bd..dcf8b841266b097aff66549d0903883ffe58d7af 100644 (file)
@@ -179,6 +179,8 @@ class _GapLine(_DatLineSubclass):
 
     @classmethod
     def from_dat(cls, dat_line: _DatLine) -> Self:
+        if dat_line.code:  # if .code, turn whole line into comment
+            return cls('', dat_line.raw)
         return cls('', dat_line.comment)