beancount / ledger2beancount

Ledger to Beancount text-based converter
GNU General Public License v3.0
82 stars 15 forks source link

hledger: tags with comma not parsed correctly #206

Closed tbm closed 4 years ago

tbm commented 4 years ago

https://hledger.org/journal.html#tags says

A simple tag is a word (which may contain hyphens) followed by a full colon

With this example:

2020/07/27 Tag test
  ; foo,bar: test
  Assets:Test                     $10
  Assets:Test

hledger parses this as tag "foo,bar" with value "test":

hledger -f c reg tag:foo,bar=test
2020/07/27 Tag test                                                    Assets:Test                                                           $10           $10
                                                                       Assets:Test                                                          $-10             0

But ledger2beancount thinks it's tag foo and tag bar with value test.

2020-07-27 txn "Tag test"
  foo-bar: "test"
  Assets:Test                     10 USD
  Assets:Test

sm, can you confirm that a tag key can contain anything apart from colon?

tbm commented 4 years ago

Sorry, I pasted the wrong output (it was with ledger input mode).

With hledger input, I get this output from ledger2beancount:

2020-07-27 txn "Tag test"
  #foo
  bar: "test"
  Assets:Test                     10 USD
  Assets:Test

which is wrong.