From ab050e7a9415b3d60d02a360becaa25b4a9ab2f1 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 25 Dec 2019 00:55:39 +0000 Subject: fix corner case in `directives` (#3645) --- lib/parse.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/parse.js') diff --git a/lib/parse.js b/lib/parse.js index c9ee01fd..740ef5f2 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -790,9 +790,10 @@ function parse($TEXT, options) { var dir = S.in_directives; var body = expression(true); if (dir) { - var token = body.start; - if (body instanceof AST_String && token.raw.indexOf("\\") == -1) { - S.input.add_directive(token.value); + if (body instanceof AST_String) { + var value = body.start.raw.slice(1, -1); + S.input.add_directive(value); + body.value = value; } else { S.in_directives = dir = false; } -- cgit v1.2.3