Skip to content

Commit 41bdade

Browse files
committed
also treat lines beginning with * as comments, allowing org mode
1 parent cec717f commit 41bdade

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Parse.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ line = (anyChar `manyTill` newline) <?> "rest of line"
390390
whitespacechar = oneOf " \t"
391391
whitespace = many whitespacechar
392392
whitespaceline = try (newline >> return "") <|> try (whitespacechar >> whitespacechar `manyTill` newlineoreof)
393-
commentline = try (whitespace >> char '#' >> lineoreof) <?> "comments"
393+
-- a line beginning with optional whitespace and #, or beginning with one or more * (an org node)
394+
commentline = try ((many1 (char '*') <|> (whitespace >> many1 (char '#'))) >> lineoreof) <?> "comments"
394395
whitespaceorcommentline = commentline <|> whitespaceline
395396
whitespaceorcommentlineoreof = choice [eofasstr, commentline, whitespaceline]
396397
eofasstr = eof >> return ""

0 commit comments

Comments
 (0)