Skip to content

Add batch script support and fix minor issues#4380

Open
megyerikenez wants to merge 5 commits intohighlightjs:mainfrom
megyerikenez:main
Open

Add batch script support and fix minor issues#4380
megyerikenez wants to merge 5 commits intohighlightjs:mainfrom
megyerikenez:main

Conversation

@megyerikenez
Copy link

Changes

This pull request introduces syntax highlighting support for Windows batch files to the project. The main addition is a new language definition for batch scripts, along with relevant tests to ensure proper detection and markup of batch syntax elements.

Batch language support:

  • Added a new language definition file src/languages/batch.js for Windows batch files, supporting .bat, .batch, and .cmd extensions, with highlighting for built-in commands, operators, comments, strings, variables, and numbers.

Testing and validation:

  • Added detection test file test/detect/batch/default.txt to verify that batch files are correctly identified by the language detector.
  • Added markup test input test/markup/batch/default.txt and expected output test/markup/batch/default.expect.txt to validate syntax highlighting for various batch commands, comments, variables, and control structures. [1] [2]

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md

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.

1 participant