Skip to content
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 while condition is incorrect, scoping doesn't match preview or GitHub #56

Open
msftrncs opened this issue Aug 26, 2019 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@msftrncs
Copy link

Copying comment from another repository: microsoft/vscode-textmate#110 (comment)

Example:

> one nest.
>> second nest, new paragraph.
> continues paragraph of second nest.
also continues paragraph of second nest.

Actually (via GitHub):

one nest.

second nest, new paragraph.
continues paragraph of second nest.
also continues paragraph of second nest.

VS Code Editor highlight:
image

From VS Code Preview:
image

I believe VS Code's Markdown grammar is wrong. The while rule is expecting to find additional lines starting with > but that is not how the previewer works. I believe the correct test is, at a minimum, a non-blank line. but possibly also tests for other kinds of markup, or precisely the same as the while clause of list_paragraph. This is the correct while condition for blockquote: "while": "(^|\\G)([ ]{0,3}(>) ?|(?!\\s*$|#|[ ]{0,3}([-*_>][ ]{2,}){3,}[ \\t]*$\\n?|[ ]{0,3}[*+->]|[ ]{0,3}[0-9]+\\.))". With this change, I get the correct scoping.

image

@mjbvz
Copy link
Contributor

mjbvz commented Aug 26, 2019

This seems reasonable and matches the common markspec: https://spec.commonmark.org/0.29/#block-quotes

Do you want to submit a PR and add a few tests for this?

@msftrncs
Copy link
Author

msftrncs commented Sep 3, 2019

I'll try to post a PR shortly. As I went through the spec for blockquotes, I noticed where the REGEX still failed some situations, and it became more complicated to correct, but I think I have it.

@mjbvz mjbvz added the help wanted Issues identified as good community contribution opportunities label Jun 3, 2022
@mjbvz mjbvz added this to the Backlog milestone Dec 5, 2022
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

2 participants