Pygments

generic syntax highlighter


Ticket #420 (closed defect: wontfix)

Opened 14 months ago

Last modified 12 months ago

Pygments' PythonLexer eats leading blank lines

Reported by: guest Owned by: gbrandl
Priority: major Milestone: 1.1
Component: other Keywords:
Cc: inform@…

Description (last modified by thatch) (diff)

Steps to reproduce:

  1. go to dumpz.org
  2. click "Python"
  3. enter a blank line, then a line of Python code
  4. click "Submit"
  5. Observe leading blank line has disappeared

(I observed this in PuDB, but dumpz makes for a convenient way of demonstrating the bug.)

Change History

Changed 14 months ago by thatch

  • component changed from docs to other
  • description modified (diff)
  • milestone set to 1.1

Confirmed, it also happens in pygmentize. Doesn't appear to be confined to the Python lexer though.

Changed 12 months ago by gbrandl

  • status changed from new to closed
  • resolution set to wontfix

Lexers always strip newlines from the input, unless you give the "stripnl=False" option.

Note: See TracTickets for help on using tickets.