Closed paulroub closed 6 years ago
Thanks for coming up with a solution for this! I'm hoping there's a way we can modify this to not introduce any extra syntax into the content though. Maybe the right way is to not use regular expressions and instead just manually check character-to-character in getAllTags
. That way we don't have to mess with write, just read and parse! Thoughts?
Without the extra syntax, how would you know when you've reached the end of the tag, and not just an embedded )
?
You'd end up using counters for open/close. Like every (
is +1 and every )
is -1, then you read characters until the value becomes 0 (which means you've closed out the starting (
) or you reach the end of the current line!
Nope. No guarantee that someone won't name a project # I am bad at parens)
, and then your count will be wrong. Hence the need for escaping in this one (slightly weird) case.
Makes sense. Based on your code, this would only apply to tags added via the package, so I think this is fine :)
You'll just have to rebase on the fixed tests!
Looks good to me! I'll merge it now and then put out a release later today :) Thanks for your input and help on this!
per Proposal, require that both ( and ) are always escaped in tag values? (Hog Bay TaskPaper support), to fix #74
Escape parens when adding a tag with a value (among others, collected project names when marking an item done). Look for an unescaped right paren when retrieving a tag's value.