File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ syntax region jsxTag
4343" and self close tag
4444" <tag/>
4545" s~~~~e
46+ " A big start regexp borrowed from https://git.io/vDyxc
4647syntax region jsxRegion
47- \ start = + <\z([^ /!?<> = " ':]\+ \)+
48+ \ start = + \(\( ( \| { \| } \|\[\|\]\| , \| && \| || \| ? \| : \| = \| = > \|\W return \| ^ return \|\W default \| ^ \| > \)\_ s * \)\@ <= < \z ([_ \$ a - zA - Z] \(\.\? [ \$ 0 - 9 a - zA - Z] \+\) * \) +
4849 \ skip = + <!--\_.\{-}--> +
4950 \ end = + </\z1> +
5051 \ end = + />+
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ class App extends Component {
33 // NOTCE: no `;` after.
44 const arr = < div > </ div >
55
6- // Codes highlight incorrectly
76 var foo = 'foo' ;
87 if ( foo === 'foo' ) {
98 console . log ( 'hello' ) ;
@@ -12,8 +11,21 @@ class App extends Component {
1211 var el = a < 0
1312 ? < div > </ div >
1413 : < a > </ a >
15-
14+ var a = ( a > b ) < a
1615 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 >
1729 }
1830}
1931
@@ -23,7 +35,9 @@ class Hoge extends React.Component {
2335 this . state = { } ;
2436 if ( foo <= 300 ) {
2537 return < div style = { { margin :0 } } >
26- Hello world
38+ < div > hello, world</ div >
39+ < table . row hello = "world" >
40+ </ table . row >
2741 </ div >
2842 }
2943 }
@@ -96,6 +110,7 @@ export const Hoge = () => (
96110 hoge = { aaa }
97111 hoge = { aaa }
98112 />
113+ { foo && < div > foo</ div > }
99114 </ div >
100115)
101116
You can’t perform that action at this time.
0 commit comments