-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strips whitespace to be more compatible with pandoc output #1502
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch! One minor implementation-related question inline.
src/Cryptol/Parser/Unlit.hs
Outdated
@@ -105,7 +105,7 @@ markdown = blanks [] | |||
|
|||
isOpenFence l | |||
| "```" `Text.isPrefixOf` l' = | |||
Just $ case Text.drop 3 l' of | |||
Just $ case Text.strip (Text.drop 3 l') of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it suffice to just use Text.dropWhile isSpace
here instead of Text.strip
? The latter strips off whitespace from the end of the line, but I don't think that is necessary here, given that the code is already checking is cryptol
is a prefix. As a result, it shouldn't matter if there is trailing whitespace at the end. (Please correct me if I've overlooked something, of course.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that's right :) I'll make that tweak and push...
One more thing: would you be able to add a test case that exercises this new feature? (If not, I can push a test case myself when I have a chance.) |
Sure, let me take a look |
Addresses #1501