don't treat comments as part of ledger transaction descriptions
This commit is contained in:
		
							parent
							
								
									eb3ec063d0
								
							
						
					
					
						commit
						69ce8b9a8e
					
				| @ -311,10 +311,7 @@ ledgerTransaction = do | ||||
|   date <- ledgerdate <?> "entry" | ||||
|   status <- ledgerstatus | ||||
|   code <- ledgercode | ||||
| -- ledger treats entry comments as part of the description, we will too | ||||
| --   desc <- many (noneOf ";\n") <?> "description" | ||||
| --   let description = reverse $ dropWhile (==' ') $ reverse desc | ||||
|   description <- many1 (noneOf "\n") <?> "description" | ||||
|   description <- liftM rstrip (many1 (noneOf ";\n") <?> "description") | ||||
|   comment <- ledgercomment | ||||
|   restofline | ||||
|   postings <- ledgerpostings | ||||
|  | ||||
							
								
								
									
										3
									
								
								Tests.hs
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Tests.hs
									
									
									
									
									
								
							| @ -564,6 +564,9 @@ tests = [ | ||||
|                    $ isLeft $ parseWithCtx ledgerTransaction "2009/1/1\n" | ||||
|     assertBool "ledgerTransaction should require some postings" | ||||
|                    $ isLeft $ parseWithCtx ledgerTransaction "2009/1/1 a\n" | ||||
|     let t = parseWithCtx ledgerTransaction "2009/1/1 a ;comment\n b 1\n" | ||||
|     assertBool "ledgerTransaction should not include a comment in the description" | ||||
|                    $ either (const False) ((== "a") . ltdescription) p | ||||
| 
 | ||||
|   ,"ledgerHistoricalPrice" ~: do | ||||
|     parseWithCtx ledgerHistoricalPrice price1_str `parseis` price1 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user