create-prisma-php-app 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -225,9 +225,18 @@ class TemplateCompiler
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
protected static function processNode(DOMNode $node): string
|
|
228
|
+
protected static function processNode(DOMNode $node, bool $inBody = false): string
|
|
229
229
|
{
|
|
230
230
|
if ($node instanceof DOMElement) {
|
|
231
|
+
$tag = strtolower($node->nodeName);
|
|
232
|
+
$currentInBody = ($tag === 'body') ? true : $inBody;
|
|
233
|
+
|
|
234
|
+
if ($tag === 'script' && $inBody) {
|
|
235
|
+
if (strtolower($node->getAttribute('type')) !== 'module') {
|
|
236
|
+
$node->setAttribute('type', 'module');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
231
240
|
$componentName = $node->nodeName;
|
|
232
241
|
$attributes = [];
|
|
233
242
|
foreach ($node->attributes as $attr) {
|
|
@@ -239,7 +248,7 @@ class TemplateCompiler
|
|
|
239
248
|
|
|
240
249
|
$childOutput = [];
|
|
241
250
|
foreach ($node->childNodes as $child) {
|
|
242
|
-
$childOutput[] = self::processNode($child);
|
|
251
|
+
$childOutput[] = self::processNode($child, $currentInBody);
|
|
243
252
|
}
|
|
244
253
|
$componentInstance->children = implode('', $childOutput);
|
|
245
254
|
|
|
@@ -251,7 +260,7 @@ class TemplateCompiler
|
|
|
251
260
|
} else {
|
|
252
261
|
$childOutput = [];
|
|
253
262
|
foreach ($node->childNodes as $child) {
|
|
254
|
-
$childOutput[] = self::processNode($child);
|
|
263
|
+
$childOutput[] = self::processNode($child, $currentInBody);
|
|
255
264
|
}
|
|
256
265
|
$attributes['children'] = implode('', $childOutput);
|
|
257
266
|
return self::renderAsHtml($componentName, $attributes);
|