Skip to content

Add lexers.specials.OutputLexer.#1836

Merged
birkenfeld merged 2 commits intopygments:masterfrom
doerwalter:outputlexer
Jun 7, 2021
Merged

Add lexers.specials.OutputLexer.#1836
birkenfeld merged 2 commits intopygments:masterfrom
doerwalter:outputlexer

Conversation

@doerwalter
Copy link
Copy Markdown
Contributor

This pull request adds lexers.specials.OutputLexer, a lexer that highlights everything as Token.Generic.Output as discussed in issue #1835.

Copy link
Copy Markdown
Member

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@doerwalter
Copy link
Copy Markdown
Contributor Author

We have this test failure:

               for mimetype in mimetypes:
  >               assert cls == lexers.get_lexer_for_mimetype(mimetype).__class__.__name__
  E               AssertionError: assert 'TextLexer' == 'OutputLexer'
  E                 - OutputLexer
  E                 + TextLexer

Removing the filename and MIME type configuration from from OutputLexer and _mapping.py fixes that.

I've updated the pull request.

@birkenfeld birkenfeld added the changelog-update Items which need to get mentioned in the changelog label Jun 7, 2021
@birkenfeld
Copy link
Copy Markdown
Member

Perfect, thanks!

@birkenfeld birkenfeld merged commit faf69c0 into pygments:master Jun 7, 2021
@Anteru Anteru added this to the 2.10 milestone Jun 7, 2021
@doerwalter doerwalter deleted the outputlexer branch June 7, 2021 18:51
@Anteru Anteru added A-lexing area: changes to individual lexers and removed changelog-update Items which need to get mentioned in the changelog labels Aug 8, 2021
@Anteru
Copy link
Copy Markdown
Collaborator

Anteru commented Aug 8, 2021

Merged for the next release, thanks!

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

Labels

A-lexing area: changes to individual lexers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add trivial lexer for output (using Token.Generic.Output for the complete code block)

3 participants