0 | module Text.Markdown.String
10 | eof : Recognise False
15 | blockEnd : Recognise False
17 | (newline <+> manyUntil newline space <+> newline)
18 | <|> (some newline <+> eof)
24 | blankLines = newline <+> manyThen newlines space
28 | headingSym = some (is '#')
33 | uListSym = is '-' <+> space
40 | uListSepSym = newline <+> is '-' <+> space
58 | horizontalRules : Lexer
59 | horizontalRules = (atLeast3 '*' <|> atLeast3 '-' <|> atLeast3 '_') <+> blockEnd
61 | atLeast3 : Char -> Lexer
62 | atLeast3 c = is c <+> is c <+> some (is c)
66 | openingBracket : Lexer
67 | openingBracket = is '['
71 | closingBracket : Lexer
72 | closingBracket = is ']'
76 | openingParenthesis : Lexer
77 | openingParenthesis = is '('
81 | closingParenthesis : Lexer
82 | closingParenthesis = is ')'
87 | imageStart = is '!' <+> openingBracket
95 | boldSym = count (exactly 2) (is '*')
100 | htmlOpenTag : Lexer
101 | htmlOpenTag = surround (is '<') (is '>') alphaNum
104 | htmlCloseTag : Lexer
105 | htmlCloseTag = surround (exact "</") (is '>') alphaNum
109 | pre = is '`' <+> some (non (newline <|> is '`')) <+> is '`'
114 | codeFence = count (exactly 3) (is '`') <|> count (exactly 3) (is '~')
119 | codeEnd = newline <+> codeFence <+> blockEnd
124 | code = codeFence <+> many (alphaNum) <+> newline <+> manyThen codeEnd any
129 | text = some $
non $
choice
134 | , openingParenthesis
135 | , closingParenthesis