From 807bd536e65030c1ecdc7ef98bbfb07e17b4c951 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 13 Apr 2019 12:41:57 +0100 Subject: [PATCH] Fix `inspect` for quoted strings Tests: https://github.com/sass/sass-spec/pull/1381 Fixes #2826 --- src/fn_miscs.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fn_miscs.cpp b/src/fn_miscs.cpp index 6d01c7fae0..390cf1a713 100644 --- a/src/fn_miscs.cpp +++ b/src/fn_miscs.cpp @@ -186,11 +186,16 @@ namespace Sass { { Expression* v = ARG("$value", Expression); if (v->concrete_type() == Expression::NULL_VAL) { - return SASS_MEMORY_NEW(String_Quoted, pstate, "null"); + return SASS_MEMORY_NEW(String_Constant, pstate, "null"); } else if (v->concrete_type() == Expression::BOOLEAN && v->is_false()) { - return SASS_MEMORY_NEW(String_Quoted, pstate, "false"); + return SASS_MEMORY_NEW(String_Constant, pstate, "false"); } else if (v->concrete_type() == Expression::STRING) { - return Cast(v); + String_Constant *s = Cast(v); + if (s->quote_mark()) { + return SASS_MEMORY_NEW(String_Constant, pstate, quote(s->value(), s->quote_mark())); + } else { + return s; + } } else { // ToDo: fix to_sass for nested parentheses Sass_Output_Style old_style;