Skip to content

Commit dfabbe3

Browse files
committed
Newlines need excaping inside JSON
Fixes #50
1 parent 32d9b00 commit dfabbe3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

EmbAJAX.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ void EmbAJAXOutputDriverBase::_printFiltered(const char* value, QuoteMode quoted
4242
if ((quoted == JSQuoted) && (*pos == '"' || *pos == '\\')) {
4343
_printChar('\\');
4444
_printChar(*pos);
45+
} else if ((quoted == JSQuoted) && (*pos == '\n')) {
46+
_printContent("\\n");
4547
} else if ((quoted == HTMLQuoted) && (*pos == '"')) {
4648
_printContent(""");
4749
} else if (HTMLescaped && (*pos == '<')) {

0 commit comments

Comments
 (0)