Fix output for blade tests

This commit is contained in:
Liam Newman 2018-09-05 01:07:19 -07:00
parent e2092205c8
commit f611d5765f
2 changed files with 6 additions and 4 deletions

View File

@ -5,7 +5,8 @@
</head>
<body>
@section('sidebar') This is the {{ $mater }} sidebar.
@section('sidebar')
This is the {{ $mater }} sidebar.
@show
<div class="container">
@ -13,7 +14,8 @@
</div>
@component('alert')
@slot('title') Forbidden
@slot('title')
Forbidden
@endslot
<strong>Whoops!</strong> Something went wrong!
@endcomponent

View File

@ -55,10 +55,10 @@ module.exports = class JSBeautify extends Beautifier
when "Blade"
beautifyHTML = require("js-beautify").html
# pre script (Workaround)
text = text.replace(/\@(?!yield)([^\n\s]*)/ig, "<blade $1/>")
text = text.replace(/\@(?!yield)([^\n\s]*)/ig, "<blade $1 />")
text = beautifyHTML(text, options)
# post script (Workaround)
text = text.replace(/<blade ([^\n]*)\/>/ig, "@$1")
text = text.replace(/<blade ([^\n\s]*)\s*\/>/ig, "@$1")
text = text.replace(/\(\ \'/ig, "('")
@debug("Beautified HTML: #{text}")
resolve text