Skip to content

Commit

Permalink
Merge pull request #887 from shufo/fix/inline-php-directive
Browse files Browse the repository at this point in the history
  • Loading branch information
shufo authored Nov 5, 2023
2 parents 9e1e075 + 2010b5d commit da2e0fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions __tests__/fixtures/snapshots/inline_php_directive.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
------------------------------------options----------------------------------------
{}
------------------------------------content----------------------------------------
<div @php($counter = 1)>
<x-share>
@if ($counter)
{{-- --}}
@endif
</x-share>
</div>
------------------------------------expected----------------------------------------
<div @php($counter = 1)>
<x-share>
@if ($counter)
{{-- --}}
@endif
</x-share>
</div>
4 changes: 2 additions & 2 deletions src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ export default class Formatter {
.then((target) => this.preserveRawBladeBrace(target))
.then((target) => this.preserveConditions(target))
.then((target) => this.preservePropsBlock(target))
.then((target) => this.preserveInlineDirective(target))
.then((target) => this.preserveInlinePhpDirective(target))
.then((target) => this.preserveInlineDirective(target))
.then((target) => this.preserveBladeDirectivesInScripts(target))
.then((target) => this.preserveBladeDirectivesInStyles(target))
.then((target) => this.preserveCustomDirective(target))
Expand Down Expand Up @@ -231,8 +231,8 @@ export default class Formatter {
.then((target) => this.restoreCustomDirective(target))
.then((target) => this.restoreBladeDirectivesInStyles(target))
.then((target) => this.restoreBladeDirectivesInScripts(target))
.then((target) => this.restoreInlinePhpDirective(target))
.then((target) => this.restoreInlineDirective(target))
.then((target) => this.restoreInlinePhpDirective(target))
.then((target) => this.restoreConditions(target))
.then((target) => this.restoreRawBladeBrace(target))
.then((target) => this.restoreBladeBrace(target))
Expand Down

0 comments on commit da2e0fc

Please sign in to comment.