Fix #2926 issue in BashLexer by styx0x6 · Pull Request #2969 · pygments/pygments
This PR improves the Bash lexer by fixing an issue where keywords at the beginning of certain names were incorrectly highlighted, and updates the Bash documentation link. It also adds a new test file doif.sh and its expected output to verify the fix.
Lexer improvements:
- Fixed the Bash lexer so that keywords (like
do,if,until) are not incorrectly highlighted when they appear at the start of variable or command names containing special characters (e.g.,do-release-upgrade,do@arobase). It just excludes some problematic chars as other attempt to do it better will be more heavy changes on logic with high risj of side effects. - Updated the Bash lexer documentation URL to point to the official GNU Bash manual.
Fixes #2926