GithubHelp home page GithubHelp logo

vim-blade's Introduction

vim-blade

Vim syntax highlighting for Blade templates (Laravel 4+).

This plugin contributes to vim-polyglot language pack.

Installation

Using vim-plug vim-plug.

Plug 'jwalton512/vim-blade'

Using pathogen pathogen.vim.

cd ~/.vim/bundle
git clone git://github.com/jwalton512/vim-blade.git

Configuration

Because Blade allows you to define your own directives, you can let the plugin know about them through some variables. Examples:

" Define some single Blade directives. This variable is used for highlighting only.
let g:blade_custom_directives = ['datetime', 'javascript']

" Define pairs of Blade directives. This variable is used for highlighting and indentation.
let g:blade_custom_directives_pairs = {
      \   'markdown': 'endmarkdown',
      \   'cache': 'endcache',
      \ }

Contributing

Pull requests are greatly appreciated. Please be certain to include a test where applicable (test.blade.php). You may test locally by using vim -u vimrc.

Want to buy me a coffee?

Flattr this git repo

vim-blade's People

Contributors

0xbaddcafe avatar adriaanzon avatar jaguadoromero avatar jn-jairo avatar jwalton512 avatar mrshunz avatar mxaddict avatar rendom avatar sheerun avatar tremby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-blade's Issues

The syntax for blade.php files is not set automatically to "blade"

I got vim-blade as part of sheerun/vim-polyglot which I installed via vundle on Linux Mint 18 Sarah 64 bit. The syntax works fine but I have to manually set it since vim does not seem to recognize viewname.blade.php as a blade file but as php. My airline as well as the set filetype? command say so. My workaround so far (thx to romainl) is an autocommand in my vimrc:

augroup blade
autocmd!
autocmd BufNewFile,BufRead *.blade.php set filetype=blade
augroup END

but since no one else mentioned it as an issue so far, is was wondering where I could have screwed up during installation :)

Allow space between @keyword and its open parenthesis

@foreach($things as $thing) highlights properly but @foreach ($things as thing) does not, though it is valid Blade. The @foreach renders in the wrong colour and the contents of the parentheses are not highlighted as PHP.

HTML tag indented after ?>

In this one, it doesn't matter if line 4 exists or not. If line 5 is not indented it highlights properly. It seems the problem occurs when the <?php ?> block exists and the next HTML is indented, whether or not there is a blade line between them.

<?php
$var = rand();
?>
@if ($test)
    <div>
        {{{ $var }}}
    </div>
@endif

screen shot 2014-03-11 at 1 34 23 pm

Testing with synchk unreliable

As mentioned in #18, testing with synchk isn't robust.

Highlighting is different in two successive commits, the synchk files and test cases haven't changed, but it says tests pass on each one. I've tried with my full vim open too, so it's not to do with how I'm invoking it in the test.sh script.

I can't spend time on it just now, but this ticket is to look into possibly improving synchk or looking for an alternative testing solution.

I emailed the author back when I threw it in a repository on Github and never received a reply, so I doubt it's possible to get him to help find a solution.

Test case idea

Highlighting plugins seem like the kind of project which could really use test cases since I imagine they're pretty susceptible to regressions.

I figure it might be pretty easy to build a test case for a current version by using the :TOhtml function in vim and dumping that in a file, then the test case can check the current output against the saved. Once satisfied that a new change doesn't regress anything, the new test blade code is added and the HTML regenerated.

Just an idea.

Highlighting within HTML tags

Here's a tricky one:

<p>
    {{ $address }}{{-- Double braces on purpose: already escaped --}}
    @if ($address && $document->getMyText('phone'))
        <br/>
    @endif
    @if ($document->getMyText('phone'))
        T: <a href="tel:{{{ $document->getMyText('phone') }}}">Phone {{{ $document->getMyText('phone') }}}</a>
    @endif
    @if ($document->getMyText('phone') && $document->getMyText('email'))
        or
    @endif
    @if ($document->getMyText('email'))
        E: <a href="mailto:{{{ $document->getMyText('email') }}}">Email {{{ $document->getMyText('email') }}}</a>
    @endif
</p>
<em>
    {{ $address }}{{-- Double braces on purpose: already escaped --}}
    @if ($address && $document->getMyText('phone'))
        <br/>
    @endif
    @if ($document->getMyText('phone'))
        T: <a href="tel:{{{ $document->getMyText('phone') }}}">Phone {{{ $document->getMyText('phone') }}}</a>
    @endif
    @if ($document->getMyText('phone') && $document->getMyText('email'))
        or
    @endif
    @if ($document->getMyText('email'))
        E: <a href="mailto:{{{ $document->getMyText('email') }}}">Email {{{ $document->getMyText('email') }}}</a>
    @endif
</em>
<strong>
    {{ $address }}{{-- Double braces on purpose: already escaped --}}
    @if ($address && $document->getMyText('phone'))
        <br/>
    @endif
    @if ($document->getMyText('phone'))
        T: <a href="tel:{{{ $document->getMyText('phone') }}}">Phone {{{ $document->getMyText('phone') }}}</a>
    @endif
    @if ($document->getMyText('phone') && $document->getMyText('email'))
        or
    @endif
    @if ($document->getMyText('email'))
        E: <a href="mailto:{{{ $document->getMyText('email') }}}">Email {{{ $document->getMyText('email') }}}</a>
    @endif
</strong>
<a href="http://example.com">
    {{ $address }}{{-- Double braces on purpose: already escaped --}}
    @if ($address && $document->getMyText('phone'))
        <br/>
    @endif
    @if ($document->getMyText('phone'))
        T: <span class="tel:{{{ $document->getMyText('phone') }}}">Phone {{{ $document->getMyText('phone') }}}</span>
    @endif
    @if ($document->getMyText('phone') && $document->getMyText('email'))
        or
    @endif
    @if ($document->getMyText('email'))
        E: <span class="mailto:{{{ $document->getMyText('email') }}}">Email {{{ $document->getMyText('email') }}}</span>
    @endif
</a>

screen shot 2014-03-11 at 11 33 43 am

  • The blade comment should always be highlighted as a blade comment (lines 17, 32, 47 should look like line 2)
  • The blade directives @whatever should always be yellow (in my scheme) (lines 20, 23, etc are rendering in the HTML tag's special way (italic, bold...))
  • I don't expect to see the HTML highlighting (visible as the link underline) as part of blade directives on lines 48, 51, 54, 57 (space after @if)
  • I do expect plain text to be highlighted in the HTML tag's special way ("T:" on line 22, "or" on line 25, 40, 55, etc)

Unable to properly comment files

Vim is commenting using generic commenting syntax /* */ instead of blade, html, and php syntax for *.blade.php files.

Does anyone else have this issue?

Example code before:

@extends('layout')

@section('styles')
<style>
</style>
@stop

@section('content')
<h1 class="page-header">Journal</h1>

<div class="btn-group btn-group-justified">
    <div class="btn btn-default btn-group">Log</div>
    <div class="btn btn-primary btn-group">Log</div>
    <div class="btn btn-success btn-group">Log</div>
</div>
...

Example code after commenting:

@extends('layout')

/*@section('styles')*/
/*<style>*/
/*</style>*/
/*@stop*/

/*@section('content')*/
/*<h1 class="page-header">Journal</h1>*/

/*<div class="btn-group btn-group-justified">*/
    /*<div class="btn btn-default btn-group">Log</div>*/
    /*<div class="btn btn-primary btn-group">Log</div>*/
    /*<div class="btn btn-success btn-group">Log</div>*/
/*</div>*/
...

Installed bundles are:

Plugin 'gmarik/vundle'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'scrooloose/nerdtree'
Plugin 'altercation/vim-colors-solarized'
Plugin 'spf13/vim-colors'
Plugin 'tpope/vim-surround'
Plugin 'spf13/vim-autoclose'
Plugin 'kien/ctrlp.vim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'vim-scripts/sessionman.vim'
Plugin 'matchit.zip'
Plugin 'bling/vim-airline'
Plugin 'bling/vim-bufferline'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'godlygeek/csapprox'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'flazz/vim-colorschemes'
Plugin 'mbbill/undotree'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'vim-scripts/restore_view.vim'
Plugin 'mhinz/vim-signify'
Plugin 'tpope/vim-abolish.git'
Plugin 'osyo-manga/vim-over'
Plugin 'kana/vim-textobj-user'
Plugin 'kana/vim-textobj-indent'
Plugin 'reedes/vim-litecorrect'
Plugin 'reedes/vim-textobj-sentence'
Plugin 'reedes/vim-textobj-quote'
Plugin 'reedes/vim-wordy'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-fugitive'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'godlygeek/tabular'
Plugin 'majutsushi/tagbar'
Plugin 'Shougo/neocomplcache'
Plugin 'Shougo/neosnippet'
Plugin 'Shougo/neosnippet-snippets'
Plugin 'honza/vim-snippets'
Plugin 'spf13/PIV'
Plugin 'arnaud-lb/vim-php-namespace'
Plugin 'klen/python-mode'
Plugin 'python.vim'
Plugin 'python_match.vim'
Plugin 'pythoncomplete'
Plugin 'elzr/vim-json'
Plugin 'groenewege/vim-less'
Plugin 'pangloss/vim-javascript'
Plugin 'briancollins/vim-jst'
Plugin 'kchmck/vim-coffee-script'
Plugin 'amirh/HTML-AutoCloseTag'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'gorodinskiy/vim-coloresque'
Plugin 'tpope/vim-haml'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-markdown'
Plugin 'spf13/vim-preview'
Plugin 'tpope/vim-cucumber'
Plugin 'quentindecock/vim-cucumber-align-pipes'
Plugin 'Puppet-Syntax-Highlighting'
Plugin 'beyondwords/vim-twig'
Plugin 'digitaltoad/vim-jade'
Plugin 'Glench/Vim-Jinja2-Syntax'
Plugin 'mattn/emmet-vim'
Plugin 'phleet/vim-arcanist'
Plugin 'xsbeats/vim-blade'
Plugin 'othree/html5.vim'

EDIT:
:set comments shows this:
comments

Having {{ more than one line and then }}

@extends('layout.default')

@section('form')

{{
    Former::open()
        ->class("form-horizontal well")
        ->data_async(null) 
        ->data_target("#myModal")
        ->route("head.update", $user->id)
        ->method('PUT')
}}

{{ Former::populate($user) }}

@stop

All but the open form is recognised, removing oneline from blade.vim made it work. As you may know it tells vim that the statement is in one line.

Accessing an object's property inside of an html tag causes highlighting to get confused

I'm using

<option @if($prod->key) selected @endif value="yes">Yes</option>

and it gets confused when it encounters > and the highlighting is screwed up until the closing </option> tag.

When testing this, I realized that it has trouble with the data keyword as well...but that just might be from a conflict with html5.vim. Come to think of it, maybe it all has to do with the fact that I'm using othree/html5.vim? Does this affect anyone else?

screen shot 2018-03-22 at 11 48 53 am

Line outdents when using -> inside Blade tag

Example file (named test.blade.php):

<div>
    |
</div>

Pipe shows where to position the cursor. In insert mode, type: {{ $foo->

Upon hitting the > key, the line will outdent.

I'm using the latest version of NeoVim and vim-blade on Arch Linux. The ft is indeed blade and I don't think there's anything in my config which could be messing with this.

commenting bug

There seems to be a bug in the commenting syntax. Comments only works/behaves as expected when both the comment _head_ and _tail_ symbols are adjacent to the _first_ and _last_ lines of a block respectively.
AFAIK, comment syntax _should_ be grayed out.

Here's the code:

First scenario

this one behaves as expected
_Note_ : the head and tail comment symbols are adjacent to the first and last lines. Comments are _properly grayed out_

{{-- <ul class="errors">
    @foreach($errors->get('first_name') as $message)
        <li>{{ $message }}</li>
    @endforeach
</ul> --}}

This following code is not commented out.

 {{ Form::label('first_name', 'First Name', array('id' => 'first_name')) }}
 {{ Form::text('first_name', 'chan') }}
 {{ Form::submit('Save') }}
 {{ Form::close() }}

Here's the bug:

Second scenario

_Note:_ The bug is commenting syntax is not applied. _They're not grayed out_.

{{-- 
 <ul class="errors">
    @foreach($errors->get('first_name') as $message)
        <li>{{ $message }}</li>
    @endforeach
</ul> 
--}}

 {{ Form::label('first_name', 'First Name', array('id' => 'first_name')) }}
 {{ Form::text('first_name', 'chan') }}
 {{ Form::submit('Save') }}
 {{ Form::close() }}

Multiline comments not highlighting properly

Not sure if this is related to #2.

| have this right now:

{{-- Important to have no leading whitespace
--}}<li data-node-id="{{{ $model->getKey() }}}">
    <div class="sort-tolerance">
        <span class="sort-handle glyphicon glyphicon-move"></span>
        {{{ $model->name }}}
    </div>
    @include('admin.menu-items.children', ['model' => $model])
</li>{{--
This comment stops any trailing whitespace
--}}

It's highlighting as one big comment.

Some keywords are highlighting within Blade comments

{{--
List from http://www.php.net/manual/en/reserved.keywords.php
__halt_compiler()
abstract
and
array()
as
break
callable
case
catch
class
clone
const
continue
declare
default
die()
do
echo
else
elseif
empty()
enddeclare
endfor
endforeach
endif
endswitch
endwhile
eval()
exit()
extends
final
finally
for
foreach
function
global
goto
if
implements
include
include_once
instanceof
insteadof
interface
isset()
list()
namespace
new
or
print
private
protected
public
require
require_once
return
static
switch
throw
trait
try
unset()
use
var
while
xor
yield
__DIR__
__FILE__
__FUNCTION__
__LINE__
__METHOD__
__NAMESPACE__
__TRAIT__
--}

Rendering as
screen shot 2014-04-10 at 1 04 05 pm

E218: autocommand nesting too deep

Since installing vim-blade, whenever I switch to blade file, I get the following error (twice!):

Error detected while processing BufRead Auto commands for "*.blade.php":
E218: autocommand nesting too deep

I am using Cream (I know, bring on the shame), so that may be conflicting somehow. Unfortunately I had to disable the plugin for now due to this issue.

Multi-line @include statements not highlighting

These were not supported prior to Laravel 4.2 (at a guess. They are not supported in 4.1.something and are in 4.2.something. See laravel/framework#2775 (please ignore my misplaced blame)).

Example:

@include('admin.misc.sort-header', [
    'column' => 'name',
])

Currently the @include is highlighted but nothing else is, save an HTML error at the >.

Regression, which testing didn't catch

Sadly it seems the synchk method of testing is not robust. :(

In the latest commit 342a591 various parts of the test cases no longer highlight properly, even though the tests say they pass.

Two such snippets are in the following:

@if ($document->getMyText('phone') && $document->getMyText('email'))
    or
@endif
@if (count($records) > 0)
    <p>I have records!</p>
@elseif (count($records) < 0)
    <p>I owe records!</p>
@endif

which currently looks like this:

screen shot 2014-03-13 at 10 36 05 am

On b494405 it looks like this:

screen shot 2014-03-13 at 10 36 34 am

Tests pass on both, so sadly it looks like they can't be relied upon. I'll make a separate ticket for doing something about that.

Indent issue

Hi,

I have a problem with indentation on *.blade.php files.
I was using this trick based on the following issue #1

autocmd BufNewFile,BufRead *.blade.php set ft=html | set ft=phtml | set ft=blade " Fix blade auto-indent
@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
|
@endforeach

When it should be

@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
   |
@endforeach

The following command outputs:

:set ft?
filtetype=blade

How to solve it?

Regards,

Too long lines breaks blade highlight

I have the following piece of code in one of my blade files.
For some reason, the first line of code breaks the highlight as seen on the screenshot

<button class="navbar-toggler"  data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
    <span class="navbar-toggler-icon"></span>
</button>

captura de pantalla 2018-08-26 a la s 18 53 10

If I break the first line in two lines, the higlight works as expected.

Colon after todo comment

Because I added : to 'syn iskeyword' in 95809e7, todo comments (like TODO, NOTO, FIXME) aren't highlighted anymore, when they're followed by a colon.

This can be fixed by using syn match with a regular expression for bladeTodo, but I think adding support for colons in blade directives shouldn't interfere with other syntax groups.

So should we use a regular expression for bladeKeyword? Or does someone know a better solution?
I was thinking about something like this:

syn match bladeKeyword "\v<\@(if|foreach|for|include|etc)>"

then you can add matches for directives with colons in them, without the need for : in 'syn iskeyword'.

Php and html indentation breaks when using html5 plugin

When editing a blade file the filetype becomes BLADE but then auto indentation for HTML and PHP (within <?php, ?> tags no longer works as spected).

Should blade indent bring in html and php indent files?

For proper html autoindent inside php files i'm using this plugin:

                  Plug 'captbaritone/better-indent-support-for-php-with-html'

Indentation and syntax borked in Laravel 5.5

I just pulled a fresh installation of Laravel and took a look in the default welcome.blade.php file.

Hit gg V G = and ended up with the following results.

Before:
image

After:
image

Clearly, the indentation is all wrong and the syntax highlighting doesn't seem to recognize the new custom if-conditionals (@auth and its closing tag @endauth) - the latter seemingly being the root of the problem.

Single-line comments are overriding }}

<div>
    TODO: looks selection
    {{ Form::hidden('look1', 'look1') // TODO }}
</div>

Rendering as

screen shot 2014-05-22 at 5 00 48 pm

The }} should override the comment. At present the }} is still rendered as a comment, and the PHP mode has not been cancelled, so the next line (</div>, HTML) is still rendered as PHP.

Highlighting issue after <?php section

Here's a new one for you... ;)

Input:

<div class="dropdown-box dropdown-list">
    <?php
    $featuredEvents = $mainMenu->children()->where('class', '=', 'featured-events')->firstOrFail();
    ?>
    {{ $featuredEvents->asHtml([], function($menuItem, $li) use ($featuredEvents) {
        // Skip submenus
        if ($menuItem->depth > $featuredEvents->depth + 1) {
            return false;
        }
        return $li;
    }); }}
</div>

Output:
screen shot 2014-03-03 at 3 58 04 pm

Comment not highlighting immediately after @include()

In the following snippet the comment and the end of the @include line and at the beginning of the @endforeach line is not highlighting.

{{-- It's important there's no whitespace between and around ol's children --}}
<ol class="nested-sortable">{{--
    --}}@foreach ($model['children'] as $node){{--
        --}}@include('admin.menu-items.item', ['model' => $node, 'parentId' => $model]){{--
    --}}@endforeach{{--
--}}</ol>

Auto indent issue

Trying to use this plugin to develop in Laravel. Syntax looks nice, but the indentation doesn't seem to work properly. Given this sample code below, when I press o at the cursor # the new line | starts at the very beginning not at the proper indentation level.

@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
|
@endforeach

When it should be:

@foreach ($articles as $article)
   <h1>{{ $article->title }}</h1>
   <p>{{ $article->content }}</p>#
   |
@endforeach

This happens at any indentation level. Any ideas how to fix it?

Issue highlighting PHP inside @if statement

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

Highlighting as
screen shot 2014-03-04 at 3 05 03 pm

The code in the @if statement is not highlighting properly.

Add `@props` directive to the supported directives list

From what I can tell, it seems that the @props directive that is used by Laravel to make Blade Components (here) isn't supported by default at the moment.

Since this is a Laravel-supported directive, I think it would make sense to add into the plugin. Right now, I can get around it fairly easily by using the vim configurations for custom directive (thanks for adding that, by the way–it's super helpful), but it would be nice to not have to worry about adding @props to the list myself.

I'm happy to take a stab at this issue, but I'm going out of town shortly for about a week, so I figured that I'd go ahead and open an Issue in case anyone wanted to work on this while I'm away from my computer.

Also, as always, if this isn't an issue, please let me know!

Thanks for supporting this plugin! It's a huge part of my vim workflow for Laravel development πŸ‘πŸ»

Auto indent issues

I have the following problem with the auto indentation of this plugin (don't really know if is really a problem), when I let the plugin auto-indent my .blade files, the html part of the code are indented all at the same level.

captura de pantalla 2016-04-26 a las 12 45 51 1

I can use set ft=html and indent everything with ggvG= and then return to set ft=blade but it is really annoying.

HTML closing tag fails to outdent

Steps to reproduce:

  1. Open a new file with a .blade.php filename.

  2. Enter insert mode and type the following:

     <div><CR></div><CR>
    
  3. Upon pressing the first <CR>, line 2 (which is empty apart from the cursor) will be indented. This makes sense so far.

  4. Upon pressing the second <CR>, line 2 (now containing an indent + </div>) remains indented. It should be outdented.

Bisected to the following commit:

commit 1e1f2c358b8e1958d322efab669082756e22c304
Author: Adriaan Zonnenberg <[email protected]>
Date:   Tue Jul 5 23:07:17 2016 +0200

    Fix resetting of PHP indentation
    
    There were a few problems with the PHP indentation resetting to 0.
    
    - When you pressed return after typing `<?php`:
      Removing `*<Return>` from indentkeys solved this.  When you press
      return now, the next line still gets indented, but the current line
      doesn't get reindented anymore.  I don't think you will need this
      behavior very often so think it is safe to remove.
    
    - When there was a comment on the first line of a PHP block:
      The indentation on the next line got reset when the first line of a
      PHP block was a comment. Fixed this by skipping `searchpair` if the
      line is a comment.
    
    I added `0=}},0=!!}` to indentkeys, which reindents the line when you
    type `}}` or `!!}` at the beginning of a line (ignoring whitespace).

Specifically, adding *<Return> back to the indentkeys line fixes it for me.

@adriaanzon Thoughts?

Various issues with example blade files

I'm on a 256-colour terminal, using the default colour scheme with bg=dark.

The example files are highlighting for me like this:

screenshot

example.blade.php

  • About half way down starting at the @if statement things are highlighting in green for me rather than yellow. If I remove the immediately preceding {{ }} section, it's yellow. So I guess something with the {{ }} is screwing it up. It also highlights as yellow if I make the {{ }} section all one line.
  • The > and < symbols in PHP sections are highlighting as errors.
  • Potentially related to < not rendering properly: on the line @for ($i = 0; $i < 10; $i++) the highlighting is getting messed up starting at the <.

example2.blade.php

  • In <a href="{{ $subscriber->email }} "> the contents of the {{ }} are not being highlighted as PHP. The same issue is shown again on the <form line.

example3.blade.php seems fine.

Not working on janus with mvim

Hi,
I've installed the plugin and as you can see in the screenshot, the file is detected as a blade file, but no colors...
What am I doing wrong?

Screenshot

Inline blade conditionals

You must hate me by now!

@if ($a == 'b') <h1>Same!</h1> @endif
<div>
    <h2 class="big-heading {{{ $h1Class }}} @if ($a == 'b') same-class @endif" @if ($a == 'b') data-extra-attr="same" @endif>
        H2 content
    </h2>
</div>

screen shot 2014-03-12 at 3 18 30 pm

The first line illustrates that the plugin currently doesn't highlight inline blade conditionals properly.

The rest shows that conditionals within an HTML attribute aren't recognized at all, and then that conditionals inside an HTML tag are recognized but don't reset the context properly, both inside the conditional (same issue as line 1 perhaps) and after the conditional.

The wrongly highlighted </h2> tag looks like an issue we've seen before, but I imagine it'll be fine once the rest of this ticket is seen to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.