Conversation
Protect URL contents while recognizing comments after declarations. Add semantic regressions and a regenerated SCSS golden. Refs pygments#2852 Assisted-By: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCSS declaration content can remain in the selector state after a property value. That state did not recognize
//comments, so comments following declarations were highlighted as operators and selector names.Add the comment rule to the SCSS selector state and protect URL contents before it runs. Quoted, unquoted, escaped and interpolated URLs keep their slashes as string content, including leading newlines and declarations without a space after
:. Shared Sass, CSS and LESS rules remain unchanged.Refs #2852. The LESS portion was addressed by #3005; this change covers the remaining SCSS selector/declaration path. It does not claim to fix the indented Sass portion. #3265 addresses percentages and placeholder selectors in the shared rules and covers a separate defect.
Validation on CPython 3.13.0:
--update-goldenspath, reviewed and then checked normally. The real CLI, 15 bounded malformed-input controls and unchanged neighboring lexer token streams were also checked. Externalnsgmls/LaTeX validation, docs, regexlint and a coverage report were not available or run.OpenAI Codex assisted the investigation, implementation, tests and description. A separate Codex agent reviewed the final source and retained verification evidence.