summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-04-14 19:59:12 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-04-14 19:59:12 +0100
commit66abb9fd7452fcf940d7fff3d57acc6bcdb47dab (patch)
treedbd5830a56a5bba62f04b85de3ae1a47f65d3271 /pygments
parent0de0badbc8cbaa356e4c8d8b426870f1b0e3b60e (diff)
downloadpygments-66abb9fd7452fcf940d7fff3d57acc6bcdb47dab.tar.gz
Don't mess up the lines in malformed psql session
Avoid interpreting a $$ string as a prompt when the psql prompt is missing.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/postgres.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py
index f85b4b01..908beed8 100644
--- a/pygments/lexers/postgres.py
+++ b/pygments/lexers/postgres.py
@@ -215,7 +215,7 @@ class PostgresConsoleLexer(Lexer):
break
# 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