diff --git a/tests/webfiori/test/ui/LoadTemplateTest.php b/tests/webfiori/test/ui/LoadTemplateTest.php
index 8f3fa15..d750414 100644
--- a/tests/webfiori/test/ui/LoadTemplateTest.php
+++ b/tests/webfiori/test/ui/LoadTemplateTest.php
@@ -113,6 +113,7 @@ public function test07() {
$node = $compiler->getCompiled();
$this->assertEquals("
\n No posts.\n
", $node->toHTML());
}
+
/**
* @test
*/
@@ -135,6 +136,46 @@ public function test08() {
. ""
. "", $compiler->getCompiled()->toHTML());
}
+ /**
+ * @test
+ */
+ public function test09() {
+ $compiler = new TemplateCompiler('template.html');
+ $this->assertEquals("= 8 || someVar === 6\">\r\n"
+ . " \r\n"
+ . "
\r\n", $compiler->getCompiled()->toHTML(true));
+ }
+ /**
+ * @test
+ */
+ public function test10() {
+ $compiler = new TemplateCompiler('template2.php');
+ $this->assertEquals("= 8 || someVar === 6\">\r\n"
+ . " \r\n"
+ . "
\r\n", $compiler->getCompiled()->toHTML(true));
+ }
/**
* @test
*/
diff --git a/tests/webfiori/test/ui/template.html b/tests/webfiori/test/ui/template.html
new file mode 100644
index 0000000..4aebd1f
--- /dev/null
+++ b/tests/webfiori/test/ui/template.html
@@ -0,0 +1,12 @@
+
+
+
\ No newline at end of file
diff --git a/tests/webfiori/test/ui/template2.php b/tests/webfiori/test/ui/template2.php
new file mode 100644
index 0000000..896362d
--- /dev/null
+++ b/tests/webfiori/test/ui/template2.php
@@ -0,0 +1,14 @@
+
+
+
+
\ No newline at end of file
diff --git a/webfiori/ui/TemplateCompiler.php b/webfiori/ui/TemplateCompiler.php
index 9fcc1e1..bddbc7d 100644
--- a/webfiori/ui/TemplateCompiler.php
+++ b/webfiori/ui/TemplateCompiler.php
@@ -762,10 +762,12 @@ private static function parseAttributesHelper(Queue $queue, bool $isEqualFound,
* with the hashes.
*/
private static function replaceAttrsValues(string $htmlStr) : array {
+ $scripts = [];
+ preg_match_all("/(?<=