vwtask: Require spaces around --

There's -- in Google Drive URLs which I sometimes add to my task
descriptions.
This commit is contained in:
Tomas Janousek 2020-06-19 15:47:22 +02:00 committed by Tomas Babej
parent 9d7d90192b
commit 29adb30f00
2 changed files with 8 additions and 2 deletions

View file

@ -175,8 +175,8 @@ class VimwikiTask(object):
# * [ ] this is new task
# with project:home applied
if '--' in self['description']:
first_part, second_part = self['description'].split('--', 1)
if ' -- ' in self['description']:
first_part, second_part = self['description'].split(' -- ', 1)
new_description = first_part.strip()
modstring = second_part.strip()

View file

@ -99,3 +99,9 @@ class TestParsingVimwikiTask(object):
assert vwtask['priority'] == None
assert vwtask['due'] == None
assert vwtask['uuid'] == None
def test_not_modstring(self):
self.cache.buffer[0] = "* [ ] Task https://somewhere/dash--dash"
vwtask = self.VimwikiTask.from_line(self.cache, 0)
assert vwtask['description'] == u"Task https://somewhere/dash--dash"