Skip to content

New line at the start of code snippet is stripped in formatted ouput (python) #823

@Anteru

Description

@Anteru

(Original issue 1116 created by ngzhian on 2015-06-21T19:58:45.145782+00:00)

To reproduce

#!python

import pygments

lexer = pygments.lexers.PythonLexer()
formatter = pygments.formatters.TerminalFormatter()
pygments.highlight('\n\n#a', lexer, formatter)  # 2 empty lines then a comment

# outputs: u'\x1b[37m#a\x1b[39;49;00m\n'

should the new line at the start be stripped?

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-minorseverity: minorT-bugtype: a bugX-importedimported from Bitbucket

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions