Skip to content

Commit f13c941

Browse files
committed
Only add component definitions once
1 parent 7248988 commit f13c941

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Observer/AddAlpineComponents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private function addComponentNameToHtml(
5656
$additional .= ' x-title="'.$blockName.'"';
5757
}
5858

59-
return preg_replace('/^<([a-z]+)/msi', '<\1 '.$additional, $html);
59+
return preg_replace('/^<([a-z]+)/', '<\1 '.$additional, $html);
6060
}
6161

6262
private function isDeveloperMode(): bool

Observer/AddJsComponents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ private function addComponentNameToHtml(
4747
): string {
4848
$additional = 'data-js-component="'.$componentName.'"';
4949

50-
return preg_replace('/^<([a-z]+)/msi', '<\1 '.$additional, $html);
50+
return preg_replace('/^<([a-z]+)/', '<\1 '.$additional, $html);
5151
}
5252
}

0 commit comments

Comments
 (0)