ixmatus / orgmode-parse

Attoparsec parser combinators for parsing org-mode structured text!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Colons in headline title are wrongly parsed as tags

vfaronov opened this issue · comments

Parsing this text:

* foo: bar:
baz

results in:

Headline {depth = Depth 1, title = "foo", tags = [" bar"], ...

but should result in:

Headline {depth = Depth 1, title = "foo: bar:", tags = [], ...

A partial fix would be to limit tags to the characters allowed by the Org syntax draft (alphanumeric and some punctuation). But a headline like this would still be parsed incorrectly:

* foo bar:baz:

I confirm I also have this problem. I just found it and wanted to submit my own issue on this. Probably the solution would be to disallow spaces in tags? As far as I understand this is what org-mode does as well.

I don't have time to address this myself but I'm very open to pull requests from contributors!