diff options
-rw-r--r-- | src/uscxml/Interpreter.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index c63ccc8..8c0b660 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -604,9 +604,13 @@ void InterpreterImpl::processContentElement(const Arabica::DOM::Node<std::string } if (contentToProcess.size() > 0) { /// try to interpret as JSON - data = Data::fromJSON(contentToProcess); - if (data) - return; + std::string trimmedContent = contentToProcess; + boost::trim(trimmedContent); + if (trimmedContent.find_first_of("{[") == 0) { + data = Data::fromJSON(contentToProcess); + if (data) + return; + } /// create space normalized string std::istringstream iss(contentToProcess); std::stringstream content; |