Issue highlighting PHP inside @if statement
tremby opened this issue · 2 comments
tremby commented
Input:
@section('title')
@if ($document->get($document->getType() . '.page_title')->asText())
{{{ $document->get($document->getType() . '.page_title')->asText() }}}
@else
{{{ $document->get($document->getType() . '.title')->asText() }}}
@endif
@endsection
The code in the @if
statement is not highlighting properly.
tremby commented
I've a feeling this one is related:
<p>
<em>
{{{ $address }}}
@if ($address && $document->getMyText('phone'))
<br/>
@endif
@if ($document->getMyText('phone'))
T: <a href="tel:{{{ $document->getMyText('phone') }}}">{{{ $document->getMyText('phone') }}}</a>
@endif
@if ($document->getMyText('phone') && $document->getMyText('email'))
|
@endif
@if ($document->getMyText('email'))
E: <a href="mailto:{{{ $document->getMyText('email') }}}">{{{ $document->getMyText('email') }}}</a>
@endif
</em>
</p>
Note in particular:
- The final closing parenthesis of the first
@if
line is italic (look closely), so I think matching brackets aren't being detected properly - The
@endif
is highlighted incorrectly - The insides of the
{{{ }}}
sections on the line startingT:
aren't highlighted, but honestly I don't know if they should be or not, given that they're mixed in to HTML attributes and such. - On the second
@if
line the highlighting stops after the first)
again, and the wrong highlighting afterwards is more obvious.
tremby commented
Thanks!