Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.32: csv rules: adding a newline to comments disables field interpolation #2134

Closed
simonmichael opened this issue Dec 9, 2023 · 3 comments
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. bounty Thar's some kind o' loot on offer.. csv The csv file format, csv output format, or generally CSV-related. impact3 Affects just a few users. regression A backwards step, indicating a weakness in our QA. We don't like these. severity4 Major usability/doc bug, crash, or any regression.

Comments

@simonmichael
Copy link
Owner

simonmichael commented Dec 9, 2023

From a report by pepe_pecas in chat:

2023-01-01,1
fields date, amount
account1 (a)
comment %date \n next line

Good:

$ hledger-1.31 -f a.csv print
2023-01-01  ; 2023-01-01
    ;  next line
    (a)               1

Bad:

$ hledger-1.32 -f a.csv print
2023-01-01  ; %date
    ;  next line
    (a)               1

@simonmichael simonmichael added A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. csv The csv file format, csv output format, or generally CSV-related. regression A backwards step, indicating a weakness in our QA. We don't like these. labels Dec 9, 2023
@simonmichael simonmichael changed the title 1.32: csv rules: adding a newline comments disables field interpolation 1.32: csv rules: adding a newline to comments disables field interpolation Dec 9, 2023
@simonmichael simonmichael added severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate. impact3 Affects just a few users. severity4 Major usability/doc bug, crash, or any regression. needs:debugging To unblock: needs debugging/investigation and removed severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate. labels Dec 13, 2023
@simonmichael
Copy link
Owner Author

@jmtd I believe this is breakage from #2009, but I couldn't easily spot it; maybe you can ?

@simonmichael
Copy link
Owner Author

I think renderTemplate is failing to parse the comment at all, so just returning it uninterpolated.

@simonmichael simonmichael added the needs-release This should probably be shipped in a release soon. label Dec 16, 2023
simonmichael added a commit that referenced this issue Dec 24, 2023
In field assignment values we now parse %FIELD references, \MATCHGROUP references
and "\n" newline markers more carefully, so all can coexist.
Parsing these values might be slower than before, but hopefully not noticeably so.
@simonmichael simonmichael removed the needs:debugging To unblock: needs debugging/investigation label Dec 24, 2023
@simonmichael
Copy link
Owner Author

Fixed in master.

simonmichael added a commit that referenced this issue Jan 1, 2024
In field assignment values we now parse %FIELD references, \MATCHGROUP references
and "\n" newline markers more carefully, so all can coexist.
Parsing these values might be slower than before, but hopefully not noticeably so.
@simonmichael simonmichael removed the needs-release This should probably be shipped in a release soon. label Jan 4, 2024
@simonmichael simonmichael added the bounty Thar's some kind o' loot on offer.. label Jan 19, 2024
adept pushed a commit to adept/hledger that referenced this issue Mar 8, 2024
adept pushed a commit to adept/hledger that referenced this issue Mar 8, 2024
…el#2134]

In field assignment values we now parse %FIELD references, \MATCHGROUP references
and "\n" newline markers more carefully, so all can coexist.
Parsing these values might be slower than before, but hopefully not noticeably so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. bounty Thar's some kind o' loot on offer.. csv The csv file format, csv output format, or generally CSV-related. impact3 Affects just a few users. regression A backwards step, indicating a weakness in our QA. We don't like these. severity4 Major usability/doc bug, crash, or any regression.
Projects
None yet
Development

No branches or pull requests

1 participant