mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some code is XMLified when it shouldn't be

kirjavascript opened this issue · comments

using vim-plug and pangloss/vim-javascript

correct formatting;

correct

here's the issue, the text variable is turned into an XML tag;

issue

alternative colours;

alt

minimal .vimrc;

call plug#begin('~/.vim/plugged')

Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'

call plug#end()

let g:jsx_ext_required = 0

This is a known issue. Syntax detection in vim is done via regular expressions, so it'll never be able to capture the full grammar of any sufficiently complex language. In the case of JSX, we have to detect strings like <this as the start of an XML tag in order to switch into XML mode to highlight attributes and such, which means that certain whitespace choices are forbidden.

Some might consider this a feature, not a bug ;)