1. nibalizer
  2. pygments-main


Daniele Varrazzo  committed 0e83633

Don't mess up the lines in malformed psql session

Avoid interpreting a $$ string as a prompt when the psql prompt is missing.

  • Participants
  • Parent commits b2738b3
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/postgres.py

View file
  • Ignore whitespace
                 # Identify a shell prompt in case of psql commandline example
-                if line.startswith('$'):
+                if line.startswith('$') and not curcode:
                     lexer = get_lexer_by_name('console', **self.options)
                     for x in lexer.get_tokens_unprocessed(line):
                         yield x