[parsing] Reformat code

This commit is contained in:
Laura Hausmann 2024-05-17 22:22:42 +02:00
parent cec79da658
commit 6a3d1bd16a
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -196,7 +196,8 @@ module private MfmParser =
previousCharSatisfiesNot isNotWhitespace previousCharSatisfiesNot isNotWhitespace
>>. skipString "```" >>. skipString "```"
>>. opt (many1CharsTill asciiLetter (lookAhead newline)) >>. opt (many1CharsTill asciiLetter (lookAhead newline))
.>>. (skipNewline >>. manyCharsTill anyChar (attempt (skipNewline >>. skipString "```"))) .>>. (skipNewline
>>. manyCharsTill anyChar (attempt (skipNewline >>. skipString "```")))
|>> fun (lang: string option, code: string) -> MfmCodeBlockNode(code, lang) :> MfmNode |>> fun (lang: string option, code: string) -> MfmCodeBlockNode(code, lang) :> MfmNode
let mathNode = let mathNode =
@ -210,7 +211,8 @@ module private MfmParser =
|>> fun f -> MfmMathBlockNode(f) :> MfmNode |>> fun f -> MfmMathBlockNode(f) :> MfmNode
let emojiCodeNode = let emojiCodeNode =
skipChar ':' >>. manyCharsTill (satisfy isAsciiLetter <|> satisfy isDigit <|> anyOf "+-_") (skipChar ':') skipChar ':'
>>. manyCharsTill (satisfy isAsciiLetter <|> satisfy isDigit <|> anyOf "+-_") (skipChar ':')
|>> fun e -> MfmEmojiCodeNode(e) :> MfmNode |>> fun e -> MfmEmojiCodeNode(e) :> MfmNode
let plainNode = let plainNode =