aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2023-12-26 23:29:47 +0100
committerjakobst1n <jakob.stendahl@outlook.com>2023-12-26 23:29:47 +0100
commit0415818aa793565631595046db2df9cf7e59d3f4 (patch)
treee67b6b3fbac60fc431fee15761da5de9e6a111d8
parentf5489bc1b3732f92d475623af24c9eb55381ae1f (diff)
downloadjournal-lib-master.tar.gz
journal-lib-master.zip
Add stripping of first characters in commentsHEADmaster
-rw-r--r--src/journal_lib/parse/lexers/l_ledger.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/journal_lib/parse/lexers/l_ledger.py b/src/journal_lib/parse/lexers/l_ledger.py
index ec245f0..6bcd24e 100644
--- a/src/journal_lib/parse/lexers/l_ledger.py
+++ b/src/journal_lib/parse/lexers/l_ledger.py
@@ -181,6 +181,8 @@ class JournalLexer(LexWrapper):
# Check if the comment is at the start of a line (considering whitespaces)
line_start = t.lexer.lexdata.rfind("\n", 0, t.lexpos) + 1
pre_comment = t.lexer.lexdata[line_start : t.lexpos]
+ # Remove the leading characters
+ t.value = t.value.lstrip(" ;")
# If the comment is at the start of a line, it's a standalone comment
if pre_comment.isspace() or pre_comment == "":