Whitespace may be also added at start inside script
This commit is contained in:
parent
f43f755443
commit
cbf8730879
|
@ -1,38 +1,7 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>App Name - @yield('title')</title>
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
document.write("<blade " / > );
|
||||
</script>
|
||||
|
||||
<body>
|
||||
@section('sidebar')
|
||||
This is the {{ $mater }} sidebar.
|
||||
@show
|
||||
|
||||
<div class="container">
|
||||
@yield('content')
|
||||
</div>
|
||||
<p><span>@lang('Hi')</span></p>
|
||||
|
||||
@component('alert')
|
||||
@slot('title')
|
||||
Forbidden
|
||||
@endslot
|
||||
<strong>Whoops!</strong> Something went wrong!
|
||||
@endcomponent
|
||||
|
||||
@foreach ($users as $user)
|
||||
@if ($user->type == 1)
|
||||
@continue
|
||||
@endif
|
||||
<li>{{ $user->name }}</li>
|
||||
@if ($user->number == 5)
|
||||
@break
|
||||
@endif
|
||||
@endforeach
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script>
|
||||
@foreach ($users as $user) {
|
||||
{
|
||||
$user - > name
|
||||
}
|
||||
} @endforeach
|
||||
</script>
|
|
@ -58,7 +58,8 @@ module.exports = class JSBeautify extends Beautifier
|
|||
text = text.replace(/\@(?!(?:yield|lang))([^\n\s]*)/ig, "<blade $1 />")
|
||||
text = beautifyHTML(text, options)
|
||||
# post script (Workaround)
|
||||
text = text.replace(/<blade ([^\n\s]*)\s*\/\s*>/ig, "@$1")
|
||||
# possible whitespaces are added in `script` tag
|
||||
text = text.replace(/<\s*blade ([^\n\s]*)\s*\/\s*>/ig, "@$1")
|
||||
text = text.replace(/\(\ \'/ig, "('")
|
||||
@debug("Beautified HTML: #{text}")
|
||||
resolve text
|
||||
|
|
Loading…
Reference in New Issue