Fix title splitting logic to account for both newlines and periods (#958)

* remove period parsing in title
* fix title splitter
* revert title-body switch
* keep both splitting types
* make black happy
* make it lstrip not strip
* fix title-body order for the last time
* make black happy again
* added test
* second test for single line entry with punctuation
* delete extra blank lines
This commit is contained in:
Eshan 2020-05-27 17:14:39 -04:00 committed by GitHub
parent 63df95f2ea
commit b575174a60
2 changed files with 19 additions and 6 deletions

View file

@ -26,6 +26,18 @@ Feature: Basic reading and writing to a journal
| There is a blank line above this.
"""
Scenario: Multiline entry with punctuation
Given we use the config "basic.yaml"
When we run "jrnl This is. the title\\n This is the second line"
and we run "jrnl -n 1"
Then the output should contain "This is. the title"
Scenario: Single line entry with punctuation
Given we use the config "basic.yaml"
When we run "jrnl This is. the title"
and we run "jrnl -n 1"
Then the output should contain "| the title"
Scenario: Writing an entry from command line
Given we use the config "basic.yaml"
When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa."