From ca53ac989366b6c0519b74dc7152cb5e68c6bbad Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 4 May 2012 15:12:37 +0200 Subject: Correctly handle multiline strings in JS compressor See http://stackoverflow.com/questions/805107/how-to-create-multiline-strings for info on them. --- _test/tests/lib/exe/js_js_compress.test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to '_test/tests/lib') diff --git a/_test/tests/lib/exe/js_js_compress.test.php b/_test/tests/lib/exe/js_js_compress.test.php index cda05162d..aa8d82933 100644 --- a/_test/tests/lib/exe/js_js_compress.test.php +++ b/_test/tests/lib/exe/js_js_compress.test.php @@ -110,6 +110,17 @@ class js_js_compress_test extends DokuWikiTest { $this->assertEquals(js_compress($text),$text); } + function test_multilinestring(){ + $text = 'var foo = "this is a \\ +multiline string";'; + $this->assertEquals('var foo="this is a multiline string";',js_compress($text)); + + $text = "var foo = 'this is a \\ +multiline string';"; + $this->assertEquals("var foo='this is a multiline string';",js_compress($text)); + } + + /** * Test the files provided with the original JsStrip */ -- cgit v1.2.3