-
Notifications
You must be signed in to change notification settings - Fork 228
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
Blockquote tags #869
Blockquote tags #869
Conversation
Thanks! I will apply your reviews this week. About the options flag, I think it is not necessary for these kind of things that do not produce breaking changes (who would want to literally put in the first line of a blockquote |
So GFM seems to allow having empty lines (containing only whitespace) and indentation in the blockquote before the tag:
Note Content This seems like a style we also want to support (having extra empty lines or extra spaces). It's also pretty obvious that GitHub does this in post processing. I thought maybe we should do it like that as well. This isn't great behavior though:
Note No way to opt out? So maybe not. Regarding the Some of these miscellaneous GFM features could be grouped under the same GFM flag though. |
As for the classes emitted by the renderer, maybe they should be more specific? GitHub uses |
Looking at a few other implementations that support this syntax, most of them don't seem to let you do the blank-line-before-the-tag thing.
|
OK, I forgot there is a flag for GFM 😅, it must be used. I will handle the any number of spaces and tests will be added for this case too. Regarding the other implementations don't support an empty line before, I think that should not be supported. Thanks! |
@notriddle Gotcha. The stricter semantics make sense then. Yet another feature where GitHub's lazy implementations has very different semantics from the rest :D @Martin1887 Sorry I was unclear, there's no existing flag for GFM, but one could be added if there are many miscellaneous GFM-esque features. Maybe it doesn't make sense at this point though. |
Also I guess the extra spaces aren't supported by most other implementations either. commonmark-hs only accepts one space after, but none before. So the behavior in this PR is probably mostly ok. |
I think that all issues are solved now and the pull request can be merged. I finally added an option tag for GFM misc features, currently only for blockquote tags. Thanks! The 0.11 release is closer now! |
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.
I've put together a bunch of fixes for these bugs. It also could use more test cases.
Does most of the implementation look reasonable?
Thanks, I have checked your code and merge it. The only thing I have changed is a comment about the while loop is wrong, left after copying my reviewed code I guess. So this should be good to be merged now. |
Fixes #718.
The tags matching in
scanners.rs
and the detection of being currently in a blockquote offirstpass.rs
could probably be improved.More importantly, one of the tests currently fails with two consecutive blockquotes because the end of the previous one is not detected, so tags are not searched in the latest one.