From dabefce1b7405871564b2aab3bedbfb6cc261753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Vr=C3=A1na?= Date: Wed, 1 Jun 2016 16:06:39 -0700 Subject: [PATCH] [soy mode] Support backslash in strings --- mode/soy/soy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mode/soy/soy.js b/mode/soy/soy.js index 79bfc24dfd..580c306f15 100644 --- a/mode/soy/soy.js +++ b/mode/soy/soy.js @@ -121,10 +121,11 @@ return tokenUntil(stream, state, /\{\/literal}/); case "string": - if (stream.match(/^.*?"/)) { - state.soyState.pop(); - } else { + var match = stream.match(/^.*?("|\\[\s\S])/); + if (!match) { stream.skipToEnd(); + } else if (match[1] == "\"") { + state.soyState.pop(); } return "string"; }