diff --git a/features/data/configs/tags-237.json b/features/data/configs/tags-237.json new file mode 100644 index 00000000..55801a6d --- /dev/null +++ b/features/data/configs/tags-237.json @@ -0,0 +1,14 @@ +{ + "default_hour": 9, + "timeformat": "%Y-%m-%d %H:%M", + "linewrap": 80, + "encrypt": false, + "editor": "", + "default_minute": 0, + "highlight": true, + "password": "", + "journals": { + "default": "features/journals/tags-237.journal" + }, + "tagsymbols": "@" +} diff --git a/features/data/journals/tags-237.journal b/features/data/journals/tags-237.journal new file mode 100644 index 00000000..a1b5f5d4 --- /dev/null +++ b/features/data/journals/tags-237.journal @@ -0,0 +1,3 @@ +2014-07-22 11:11 This entry has an email. +@Newline tag should show as a tag. +Kyla's @email is kyla@clevelandunderdog.org and Guinness's is guinness@fortheloveofpits.org. diff --git a/features/tagging.feature b/features/tagging.feature index 2d317938..649ff9bf 100644 --- a/features/tagging.feature +++ b/features/tagging.feature @@ -31,3 +31,12 @@ Feature: Tagging @c++ : 1 @c# : 1 """ + Scenario: An email should not be a tag + Given we use the config "tags-237.json" + When we run "jrnl --tags" + Then we should get no error + and the output should be + """ + @newline : 1 + @email : 1 + """ \ No newline at end of file diff --git a/jrnl/Entry.py b/jrnl/Entry.py old mode 100644 new mode 100755 index 31b607c9..fb92c3b6 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -18,7 +18,7 @@ class Entry: def parse_tags(self): fulltext = " ".join([self.title, self.body]).lower() - tags = re.findall(r'(?u)([{tags}][-+*#/\w]+)'.format(tags=self.journal.config['tagsymbols']), fulltext, re.UNICODE) + tags = re.findall(r'(?u)\s([{tags}][-+*#/\w]+)'.format(tags=self.journal.config['tagsymbols']), fulltext, re.UNICODE) self.tags = tags return set(tags)