mirror of
https://github.com/The1Penguin/org-to-mafiauniverse.git
synced 2025-06-29 09:27:13 +00:00
Added example, drops until first empty line, todo list
Drops the usually headers of the document until there is a empty line
This commit is contained in:
@ -56,7 +56,7 @@ parseHelper parser x = case parse parser "" x of
|
||||
Right text -> text
|
||||
|
||||
parseFile :: String -> Post
|
||||
parseFile = Post . reduce . map (parseHelper fileParser) . lines
|
||||
parseFile = Post . reduce . map (parseHelper fileParser) . dropWhile (/= "") . lines
|
||||
|
||||
fileParser :: Parser Info
|
||||
fileParser =
|
||||
@ -70,8 +70,8 @@ fileParser =
|
||||
Image . URL <$> between (string' "[[") (string' "]]") (takeWhileP Nothing (/= ']')),
|
||||
Video . URL <$> between (string' "[[") (string' "]]") (takeWhileP Nothing (/= ']')),
|
||||
-- parseLink,
|
||||
Spoiler . (: []) . Bread <$> (string' "+BEGIN" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "+END" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "#+BEGIN" >> return ""),
|
||||
Spoiler . (: []) . Bread <$> (string' "#+END" >> return ""),
|
||||
Bread <$> takeRest
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user