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

whitespace within tag value causes error #4

Open
grahampcharles opened this issue Jan 13, 2022 · 3 comments
Open

whitespace within tag value causes error #4

grahampcharles opened this issue Jan 13, 2022 · 3 comments

Comments

@grahampcharles
Copy link

A tag in the format @tag(value) where value contains whitespace causes a Parsimmon error. For example:

@done(2022-01-22 19:30)
                ^
                parser stops

The regex on line 17 should be updated to:

const TAG = P.regex(/^^@([^\n\s]+(?:\(.*\)))/, 1)

I'll put in a PR when I'm able.

@rstacruz
Copy link
Owner

Thanks for the report! What tool makes tags like that?

@grahampcharles
Copy link
Author

The vscode TODO plugin sets tags in the format @done(YYYY-MM-DD hh:nn). More to the point, the original spec uses the regex \(((?:\\\(|\\\)|[^()])*)\) to match tag values, which allows spaces, so the parser probably should, too.

taskpaper source

tag with spaces regex match

@grahampcharles
Copy link
Author

Hm... interestingly, your code has a test for spaces in a tag value and passes it. I'm not sure why it chokes on @done(2022-01-13 14:55) in production...

grahampcharles added a commit to grahampcharles/taskpaper.js that referenced this issue Jan 13, 2022
grahampcharles added a commit to grahampcharles/taskpaper.js that referenced this issue Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants