Look up plugin lexer aliases case-insensitively by ekanshul · Pull Request #3411 · pygments/pygments · GitHub
Skip to content

Look up plugin lexer aliases case-insensitively - #3411

Open
ekanshul wants to merge 1 commit into
pygments:masterfrom
ekanshul:fix-1172-plugin-lexer-alias-case
Open

ekanshul wants to merge 1 commit into
pygments:masterfrom
ekanshul:fix-1172-plugin-lexer-alias-case

Conversation

@ekanshul

Copy link
Copy Markdown

Fixes #1172.

pygmentize -L lexers lists plugin aliases as the lexer declares them, but -l lowercased the requested name and then tested membership with in aliases. A mixed-case plugin alias such as domsaLex therefore appeared in the list and then failed with no lexer for alias 'domsaLex' found.

Lookup now compares aliases case-insensitively for both builtin and plugin lexers, matching the existing lowercasing of the requested name.

pygmentize -L lists a plugin's aliases as declared, but -l lowercased
the requested name and then did a case-sensitive membership test.
A mixed-case plugin alias such as 'domsaLex' therefore showed up in
the lexer list and then failed with "no lexer for alias found".

Fixes pygments#1172
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.

cannot used custom installed lexer

1 participant