<script> script tag for Javascript etc.
@param string $content
@param array $attributes
@return string
438962
public static function script(
        string $content, 
        array $attributes = ["type" => "text/javascript"],
        bool $addCdataTag = true
    ) : string
    {
        if ($addCdataTag) {
            $content = "\n//<![CDATA[\n" . $content ."\n//]]>\n";
        }
        return self::tag("script", $content, $attributes);
    }
350381
public static function buildHtmlElement($name, array $attributes = [], $content = null, $closeEmptyTag = true, array $cssClasses = []): string
    {
        $html = '<' . $name . self::buildAttrs($attributes, $cssClasses);
        if ($content !== null) {
            $html .= '>' . $content . '</' . $name . '>';
        } else {
            $html .= $closeEmptyTag ? ' />' : '>';
        }
        return $html;
    }
957923
public static function label($for, $content = null, array $attributes = array())
    {
        $attributes = array_merge(array('for' => $for), $attributes);

        return self::tag('label', $content, $attributes);
    }
163156
public static function createTag($tag, $htmlOptions = null, $content = null)
    {
        $return = '';
        $tag = self::clearAttributeKey(trim($tag));
        if ($tag) {
            $attributes = self::createAttributeString($htmlOptions);
            $return = '<' . $tag . (!empty($attributes) ? ' ' . $attributes : '');
            if ($content === false) {
                $return .= '>';
            } elseif ($content === true) {
                $return .= '>';
            } else {
                $return .= '>' . $content . self::createCloseTag($tag);
            }
        }

        return $return;
    }
1204500
public function tagPresent($tag, $content)
    {
        $name     = $tag['name'];
        $name     = $this->autoBuildVar($name);
        $parseStr = '<?php if(isset(' . $name . ')): ?>' . $content . '<?php endif; ?>';

        return $parseStr;
    }
1139912
public function javascriptIncludeTag($sources = "application", $attributes = [])
    {
        // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js
        $args = func_get_args();
        if (is_array(last($args))) {
            $attributes = array_pop($args);
        } else {
            $attributes = [];
        }
        $sources = is_array($sources) ? $sources : $args;
        if (empty($sources)) {
            $sources = ["application"];
        }

        $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)];

        $defaults = ['type' => 'text/javascript'];
        $attributes = $attributes + $defaults;

        $javascript_tags = [];
        foreach ((array) $sources as $source) {
            $sourceName = "$source.js";
            $javascript_tags[] = app('html')->script($this->assetPath($sourceName, $assetsOptions), $attributes);
        }

        return implode($javascript_tags);
    }
1299581
public function parse(array $tag, $content) {
        $url = isset($tag['attributes']['href']) ? $tag['attributes']['href'] : $content;
        $protocols = $this->getConfig('protocols');
        $defaultProtocol = $this->getConfig('defaultProtocol');
        $hasProtocol = preg_match('/^(' . implode('|', $protocols) . ')/i', $url);

        if (!in_array($defaultProtocol, $protocols)) {
            $defaultProtocol = 'http';
        }

        // Allow relative and absolute paths, else check protocols
        if (!preg_match('/^(\.\.?)?\//', $url)) {
            if (!$hasProtocol) {
                // Only allow if no protocol exists, just not the ones not in the list
                if (preg_match('/^(?![a-z]+:\/\/)/', $url) && filter_var($defaultProtocol . '://' . $url, FILTER_VALIDATE_URL)) {
                    $url = $defaultProtocol . '://' . $url;
                } else {
                    return $url;
                }
            }

            // Return an invalid URL
            if (!filter_var($url, FILTER_VALIDATE_URL)) {
                return $url;
            }
        }

        $tag['attributes']['href'] = $url;

        if (!empty($tag['attributes']['target'])) {
            $tag['attributes']['target'] = '_' . $tag['attributes']['target'];
        }

        if ($this->getParser()->getConfig('shorthandLinks')) {
            $tag['content'] = $this->message('link');

            return '[' . parent::parse($tag, $content) . ']';
        }

        return parent::parse($tag, $content);
    }
1372831
public static function script($text, array $attributes = [], $type = 'text/javascript')
    {
        return static::openTag('script',
            array_merge($attributes, ['type' => $type])).
            ' /*<![CDATA[*/ '.$text.' /*]]>*/ '.
            static::closeTag('script');
    }
168794
public static function tr(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("tr", $content, $attributes);
    }
265329
public static function tag($tag, $attr = [], $html = '')
    {
        // Build attributes
        $attributes = [];
        foreach ($attr as $name => $value) {
            $attributes[] = $name.'="'.$value.'"';
        }

        if (in_array($tag, self::$voidElements)) {
            return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>';
        } else {
            return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>'.$html.'</'.$tag.'>';
        }
    }
394162
public function scriptTag($content, $headers = null, $nonce = null)
    {
        if ($headers !== null && $this->shouldAppendNonce($headers)) {
            if (!$nonce) {
                throw new \Exception(
                    'Content-Security-Policy is script-src '.
                    'inline-unsafe but nonce value not provided.'
                );
            }
            
            return "\n<script type=\"text/javascript\" nonce=\"$nonce\">$content</script>";
        }
        return "\n<script type=\"text/javascript\">$content</script>";
    }
781367
public static function td(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("td", $content, $attributes);
    }
834856
private function renderTag($tag, $content = null, array $attributes = [])
    {
        $attr = [];

        foreach ($attributes as $key => $value) {
            $attr[] = sprintf(' %s="%s"', $key, $value);
        }

        if (0 < strlen($content)) {
            return sprintf('<%s%s>%s</%s>', $tag, implode('', $attr), $content, $tag);
        } else {
            return sprintf('<%s%s />', $tag, implode('', $attr));
        }
    }
888417
protected static function prepare_content ($tag, $attributes) {
		$in = '';
		if (
			$tag == 'select' ||
			$tag == 'optgroup' ||
			$tag == 'datalist'
		) {
			$in = [
				'in' => $attributes['in']
			];
			if (isset($attributes['value'])) {
				$in['value'] = $attributes['value'];
			}
			unset($attributes['in'], $attributes['value']);
		} elseif (isset($attributes['in'])) {
			$in = $attributes['in'];
			unset($attributes['in']);
		}
		return [$in, $attributes];
	}
322937
public function scripts($script = null, array $attributes = ['type' => 'text/javascript'])
    {
        $script = $script ?: $this->generateScripts();
        $attributes = $this->html->attributes($attributes);

        return new HtmlString("<script{$attributes}>{$script}</script>\n");
    }
99194
public static function coreHTMLElement($element, $content, array $attrs = []) {

        $template = "<%element%%attributes%>%innerHTML%</%element%>";

        $attributes = trim(StringHelper::parseArray($attrs));
        if (0 < strlen($attributes)) {
            $attributes = " " . $attributes;
        }

        $innerHTML = null !== $content ? trim($content, " ") : "";

        return StringHelper::replace($template, ["%element%", "%attributes%", "%innerHTML%"], [trim($element), $attributes, $innerHTML]);
    }
902295
public static function thead(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("thead", $content, $attributes);
    }