Skip to content

Fix YAML slash comments with colons#1278

Merged
alecthomas merged 1 commit into
alecthomas:masterfrom
cyphercodes:fix-yaml-slash-comments-1271
May 30, 2026
Merged

Fix YAML slash comments with colons#1278
alecthomas merged 1 commit into
alecthomas:masterfrom
cyphercodes:fix-yaml-slash-comments-1271

Conversation

@cyphercodes
Copy link
Copy Markdown
Contributor

Fixes #1271.

Summary

  • Treat // inline comment text as Comment in YAML highlighting.
  • Keep key matching from running through // comment text before a later colon.
  • Add YAML lexer fixture coverage for // comments with colon text.

Tests

  • PATH=/root/sdk/go1.26.2/bin:$PATH go test ./lexers -run 'TestLexers/YAML' -count=1
  • PATH=/root/sdk/go1.26.2/bin:$PATH go test ./... -count=1
  • git diff --check

@alecthomas alecthomas enabled auto-merge (squash) May 30, 2026 04:24
@alecthomas alecthomas merged commit e10d532 into alecthomas:master May 30, 2026
2 checks passed
@alecthomas
Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix highlight for YAML inline comments with a colon

2 participants