diff --git a/src/Compiler/ScriptCompiler.php b/src/Compiler/ScriptCompiler.php index f8b8c15..99147c4 100644 --- a/src/Compiler/ScriptCompiler.php +++ b/src/Compiler/ScriptCompiler.php @@ -2,6 +2,7 @@ namespace BladeScript\Compiler; +use Illuminate\Support\Str; use BladeScript\Contracts\Transpiler; use Illuminate\Filesystem\Filesystem; use BladeScript\Engines\MinifierEngine; @@ -79,7 +80,7 @@ public function compile($path) * @param string $script * @return string */ - public function compileScript(string $script) + public function compileScript($script) { foreach ($this->transpiler as $transpiler) { $script = $transpiler->transpile($script); @@ -109,16 +110,6 @@ public function getRaw($path) */ protected function getStyleFromString(string $string) { - preg_match('/]*>(.|\n)*?<\/x-script>/', $string, $matches); - - if (empty($matches)) { - preg_match('/(.|\n)*?<\/x-script>/', $string, $matches); - } - - if (empty($matches)) { - return; - } - - return preg_replace('/<[^>]*>/', '', $matches[0]); + return Str::between($string, '', ''); } }