Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

code containing (…) leaks into description #2563

Copy link
Copy link

Description

@eliasp
Issue body actions

A transaction with a code which contains (…) confuses hledger and it shows the trailing ) as the beginning of the transaction's payee | description.

Given a transaction llike the one below:

2025-09-03=2025-09-03 (DIG. KARTE (ANDROID) ) Nexi Germany GmbH | 2025-09-02T16:20 Debitk.12 2026-12
    foo:bar:account1            -35.16
    blah:blub:account2           35.16

I'd expect this to be parsed as:

{
    "tcode": "DIG. KARTE (ANDROID)",
    "tcomment": "",
    "tdate": "2025-09-03",
    "tdate2": "2025-09-03",
    "tdescription": "Nexi Germany GmbH | 2025-09-02T16:20 Debitk.12 2026-12"
}

…but in reality, it is:

{
    "tcode": "DIG. KARTE (ANDROID",
    "tcomment": "",
    "tdate": "2025-09-03",
    "tdate2": "2025-09-03",
    "tdescription": ") Nexi Germany GmbH | 2025-09-02T16:20 Debitk.12 2026-12"
}

The corresponding broken parsing code is:

codep = option "" $ do
try $ do
skipNonNewlineSpaces1
char '('
code <- takeWhileP Nothing $ \c -> c /= ')' && c /= '\n'
char ')' <?> "closing bracket ')' for transaction code"
pure code

Unfortunately, I lack the required langauge skills to fix this.

$ hledger --version
hledger 1.51.2, linux-x86_64
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.Something wrong, confusing or sub-standard in the software, docs, or user experience.docsDocumentation-related.Documentation-related.journalThe journal file format, and its features.The journal file format, and its features.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.