mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-15 02:01:39 +03:00
More flexible "start of code block" in Markdown mode.
This should fix #595.
This commit is contained in:
parent
843fe310f8
commit
f607b40fc3
@ -99,12 +99,17 @@ markdown = blanks []
|
||||
| otherwise = fenced op (l : current) ls
|
||||
|
||||
|
||||
isOpenFence l | "```cryptol" == l' = Just Code
|
||||
| "```" == l' = Just Code
|
||||
| "```" `Text.isPrefixOf` l' = Just Comment
|
||||
| otherwise = Nothing
|
||||
isOpenFence l
|
||||
| "```" `Text.isPrefixOf` l' =
|
||||
Just $ case Text.drop 3 l' of
|
||||
l'' | "cryptol" `Text.isPrefixOf` l'' -> Code
|
||||
| isBlank l'' -> Code
|
||||
| otherwise -> Comment
|
||||
|
||||
| otherwise = Nothing
|
||||
where
|
||||
l' = Text.dropWhile isSpace l
|
||||
|
||||
isCloseFence l = "```" `Text.isPrefixOf` l
|
||||
isBlank l = Text.all isSpace l
|
||||
isCodeLine l = "\t" `Text.isPrefixOf` l || " " `Text.isPrefixOf` l
|
||||
|
Loading…
Reference in New Issue
Block a user