From acb3b3712dc7004d1a5cc12699e2b75fd1fc6569 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 18 Oct 2016 16:38:28 -0700 Subject: [PATCH] Properly inspect singleton lists. --- lib/src/visitor/serialize.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/src/visitor/serialize.dart b/lib/src/visitor/serialize.dart index f9c468aa..021c9878 100644 --- a/lib/src/visitor/serialize.dart +++ b/lib/src/visitor/serialize.dart @@ -297,6 +297,11 @@ class _SerializeCssVisitor return; } + var singleton = _inspect && + value.contents.length == 1 && + value.separator == ListSeparator.comma; + if (singleton) _buffer.writeCharCode($lparen); + _writeBetween( _inspect ? value.contents @@ -311,6 +316,11 @@ class _SerializeCssVisitor } : (element) => element.accept(this)); + if (singleton) { + _buffer.writeCharCode($comma); + _buffer.writeCharCode($rparen); + } + if (value.hasBrackets) _buffer.writeCharCode($rbracket); }