From bee7344967e7c69780951f7bd266e65d780ce655 Mon Sep 17 00:00:00 2001 From: Shen Longxing Date: Mon, 14 Dec 2015 16:36:28 +0800 Subject: [PATCH] fix issue #213 --- sqlparse/filters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlparse/filters.py b/sqlparse/filters.py index 86624a89..68e9b1ab 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -236,13 +236,15 @@ def _stripws(self, tlist): def _stripws_default(self, tlist): last_was_ws = False + is_first_char = True for token in tlist.tokens: if token.is_whitespace(): - if last_was_ws: + if last_was_ws or is_first_char: token.value = '' else: token.value = ' ' last_was_ws = token.is_whitespace() + is_first_char = False def _stripws_identifierlist(self, tlist): # Removes newlines before commas, see issue140