-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ruff_python_formatter: add test for extraneous info string text #9050
Conversation
@ofek asked [about this][ref]. I did specifically add support for it, but neglected to add a test. This PR adds a test. [ref]: #9030 (comment)
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.
Nice
Awesome, thank you! |
|
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.
TIL that you can have additional text after the language specifier
Not in pure Markdown but extensions do support that frequently to do various things! |
Assuming pure Markdown is CommonMark, the extra text after the opening fences is called the "info string" and it does indeed permit for pretty much anything to go there. There are even examples in the spec. See: https://spec.commonmark.org/0.30/#fenced-code-blocks The spec doesn't attach any semantic value to any part of the "info string," it just specifies what is allowed there. For example, when using backticks for a fenced code block, the info string itself cannot contain backticks. But it can if you use tildes! |
@ofek asked about this. I did specifically add support for it, but neglected to add a test. This PR adds a test.