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
|
| otherwise = fenced op (l : current) ls
|
||||||
|
|
||||||
|
|
||||||
isOpenFence l | "```cryptol" == l' = Just Code
|
isOpenFence l
|
||||||
| "```" == l' = Just Code
|
| "```" `Text.isPrefixOf` l' =
|
||||||
| "```" `Text.isPrefixOf` l' = Just Comment
|
Just $ case Text.drop 3 l' of
|
||||||
|
l'' | "cryptol" `Text.isPrefixOf` l'' -> Code
|
||||||
|
| isBlank l'' -> Code
|
||||||
|
| otherwise -> Comment
|
||||||
|
|
||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
where
|
where
|
||||||
l' = Text.dropWhile isSpace l
|
l' = Text.dropWhile isSpace l
|
||||||
|
|
||||||
isCloseFence l = "```" `Text.isPrefixOf` l
|
isCloseFence l = "```" `Text.isPrefixOf` l
|
||||||
isBlank l = Text.all isSpace l
|
isBlank l = Text.all isSpace l
|
||||||
isCodeLine l = "\t" `Text.isPrefixOf` l || " " `Text.isPrefixOf` l
|
isCodeLine l = "\t" `Text.isPrefixOf` l || " " `Text.isPrefixOf` l
|
||||||
|
Loading…
Reference in New Issue
Block a user