File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ syntax region jsxTag
43
43
" and self close tag
44
44
" <tag/>
45
45
" s~~~~e
46
+ " A big start regexp borrowed from https://git.io/vDyxc
46
47
syntax region jsxRegion
47
- \ start = + <\z([^ /!?<> = " ':]\+ \)+
48
+ \ start = + \(\( ( \| { \| } \|\[\|\]\| , \| && \| || \| ? \| : \| = \| = > \|\W return \| ^ return \|\W default \| ^ \| > \)\_ s * \)\@ <= < \z ([_ \$ a - zA - Z] \(\.\? [ \$ 0 - 9 a - zA - Z] \+\) * \) +
48
49
\ skip = + <!--\_.\{-}--> +
49
50
\ end = + </\z1> +
50
51
\ end = + />+
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ class App extends Component {
3
3
// NOTCE: no `;` after.
4
4
const arr = < div > </ div >
5
5
6
- // Codes highlight incorrectly
7
6
var foo = 'foo' ;
8
7
if ( foo === 'foo' ) {
9
8
console . log ( 'hello' ) ;
@@ -12,8 +11,21 @@ class App extends Component {
12
11
var el = a < 0
13
12
? < div > </ div >
14
13
: < a > </ a >
15
-
14
+ var a = ( a > b ) < a
16
15
var b = el || < div > hello, world</ div >
16
+ var c = a < foo
17
+ var d = a < foo
18
+ var e = a > c
19
+
20
+ if ( a < b && a < d || a > c ) {
21
+ return < a > </ a >
22
+ }
23
+
24
+ if ( a < b ) {
25
+ return b < a ? < div > hello</ div > :< a > world</ a >
26
+ }
27
+
28
+ return b < a ?< div > hello</ div > :< a > world</ a >
17
29
}
18
30
}
19
31
@@ -23,7 +35,9 @@ class Hoge extends React.Component {
23
35
this . state = { } ;
24
36
if ( foo <= 300 ) {
25
37
return < div style = { { margin :0 } } >
26
- Hello world
38
+ < div > hello, world</ div >
39
+ < table . row hello = "world" >
40
+ </ table . row >
27
41
</ div >
28
42
}
29
43
}
@@ -96,6 +110,7 @@ export const Hoge = () => (
96
110
hoge = { aaa }
97
111
hoge = { aaa }
98
112
/>
113
+ { foo && < div > foo</ div > }
99
114
</ div >
100
115
)
101
116
You can’t perform that action at this time.
0 commit comments