From 26185bb4f1824d3cc96824d94f35cb241d344028 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 14 Oct 2025 16:48:37 +0200 Subject: Simplify js() function and fix boolean attributes like 'async' => true, add tests for it --- it_html.class | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index 9bb8e7a..bab85da 100644 --- a/it_html.class +++ b/it_html.class @@ -546,18 +546,16 @@ static function U(...$args) */ function js($args) { - $args = it::map(fn($v) => it::replace(['"; - } + if (($this->p['htmltype'][0] == 'x') && strlen($base)) + $base = ""; if ($this->p['htmltype'] != "html5") - array_unshift($args, array('type' => 'text/javascript')); + $params['type'] = 'text/javascript'; - return $this->_tag('script', $args); + return $this->_tag('script', [$base, $params]); } -- cgit v1.2.3