diff --git a/doc/manual.md b/doc/manual.md index 57122312d..04c90993a 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -530,9 +530,8 @@ Lines in the journal beginning with a semicolon (`;`) or hash (`#`) or asterisk (`*`) are comments, and will be ignored. (Asterisk comments make it easy to treat your journal like an org-mode outline in emacs.) -Also, anything between -[`comment` and `end comment` directives](#multi-line-comments) is a -(multi-line) comment. +Also, anything between [`comment` and `end comment` directives](#multi-line-comments) is a (multi-line) comment. +If there is no `end comment`, the comment extends to the end of the file. You can attach comments to a transaction by writing them after the description and/or indented on the following lines (before the diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index edebc7741..ec3861c57 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -995,7 +995,7 @@ multilinecommentp = do string "comment" >> many spacenonewline >> newline go where - go = try (string "end comment" >> newline >> return ()) + go = try (eof <|> (string "end comment" >> newline >> return ())) <|> (anyLine >> go) anyLine = anyChar `manyTill` newline