File tree Expand file tree Collapse file tree 3 files changed +138
-1
lines changed Expand file tree Collapse file tree 3 files changed +138
-1
lines changed Original file line number Diff line number Diff line change @@ -924,6 +924,69 @@ exports[`Markdown extensions for grid add support for parsing custom grid syntax
924
924
}
925
925
` ;
926
926
927
+ exports [` Markdown extensions for grid ignores incorrect grid like content 1` ] = `
928
+ {
929
+ " children" : [
930
+ {
931
+ " children" : [
932
+ {
933
+ " position" : {
934
+ " end" : {
935
+ " column" : 6 ,
936
+ " line" : 6 ,
937
+ " offset" : 42 ,
938
+ },
939
+ " start" : {
940
+ " column" : 1 ,
941
+ " line" : 1 ,
942
+ " offset" : 0 ,
943
+ },
944
+ },
945
+ " type" : " text" ,
946
+ " value" : " % col
947
+ orful
948
+ % clo
949
+ wn drinking
950
+ % co
951
+ fee " ,
952
+ },
953
+ ],
954
+ " position" : {
955
+ " end" : {
956
+ " column" : 6 ,
957
+ " line" : 6 ,
958
+ " offset" : 42 ,
959
+ },
960
+ " start" : {
961
+ " column" : 1 ,
962
+ " line" : 1 ,
963
+ " offset" : 0 ,
964
+ },
965
+ },
966
+ " properties" : {},
967
+ " tagName" : " p" ,
968
+ " type" : " element" ,
969
+ },
970
+ ],
971
+ " data" : {
972
+ " quirksMode" : false ,
973
+ },
974
+ " position" : {
975
+ " end" : {
976
+ " column" : 1 ,
977
+ " line" : 1 ,
978
+ " offset" : 0 ,
979
+ },
980
+ " start" : {
981
+ " column" : 1 ,
982
+ " line" : 1 ,
983
+ " offset" : 0 ,
984
+ },
985
+ },
986
+ " type" : " root" ,
987
+ }
988
+ ` ;
989
+
927
990
exports [` Markdown extensions for grid is able to parse deeply nested grid 1` ] = `
928
991
{
929
992
" children" : [
@@ -2285,6 +2348,64 @@ exports[`Markdown extensions for interpolation add support for interpolation syn
2285
2348
}
2286
2349
` ;
2287
2350
2351
+ exports [` Markdown extensions for interpolation ignores unmatched brackets 1` ] = `
2352
+ {
2353
+ " children" : [
2354
+ {
2355
+ " children" : [
2356
+ {
2357
+ " position" : {
2358
+ " end" : {
2359
+ " column" : 33 ,
2360
+ " line" : 1 ,
2361
+ " offset" : 32 ,
2362
+ },
2363
+ " start" : {
2364
+ " column" : 1 ,
2365
+ " line" : 1 ,
2366
+ " offset" : 0 ,
2367
+ },
2368
+ },
2369
+ " type" : " text" ,
2370
+ " value" : " {{f} {f} {{f !{{f} !{f} !{{f" ,
2371
+ },
2372
+ ],
2373
+ " position" : {
2374
+ " end" : {
2375
+ " column" : 33 ,
2376
+ " line" : 1 ,
2377
+ " offset" : 32 ,
2378
+ },
2379
+ " start" : {
2380
+ " column" : 1 ,
2381
+ " line" : 1 ,
2382
+ " offset" : 0 ,
2383
+ },
2384
+ },
2385
+ " properties" : {},
2386
+ " tagName" : " p" ,
2387
+ " type" : " element" ,
2388
+ },
2389
+ ],
2390
+ " data" : {
2391
+ " quirksMode" : false ,
2392
+ },
2393
+ " position" : {
2394
+ " end" : {
2395
+ " column" : 1 ,
2396
+ " line" : 1 ,
2397
+ " offset" : 0 ,
2398
+ },
2399
+ " start" : {
2400
+ " column" : 1 ,
2401
+ " line" : 1 ,
2402
+ " offset" : 0 ,
2403
+ },
2404
+ },
2405
+ " type" : " root" ,
2406
+ }
2407
+ ` ;
2408
+
2288
2409
exports [` Markdown extensions for interpolation works inside explicit markdown table 1` ] = `
2289
2410
{
2290
2411
" children" : [
Original file line number Diff line number Diff line change @@ -99,6 +99,18 @@ After grid
99
99
!{{stringField}}` )
100
100
) . toMatchSnapshot ( ) ;
101
101
} ) ;
102
+
103
+ it ( "ignores incorrect grid like content" , ( ) => {
104
+ expect (
105
+ parse ( `% col
106
+ orful
107
+ %clo
108
+ wn drinking
109
+ %co
110
+ fee
111
+ ` )
112
+ ) . toMatchSnapshot ( ) ;
113
+ } ) ;
102
114
} ) ;
103
115
104
116
describe ( "for interpolation" , ( ) => {
@@ -141,6 +153,10 @@ and appear !{{inline|with=argument}} like this
141
153
` )
142
154
) . toMatchSnapshot ( ) ;
143
155
} ) ;
156
+
157
+ it ( "ignores unmatched brackets" , ( ) => {
158
+ expect ( parse ( "{{f} {f} {{f !{{f} !{f} !{{f" ) ) . toMatchSnapshot ( ) ;
159
+ } ) ;
144
160
} ) ;
145
161
146
162
describe ( "backward compatibility" , ( ) => {
Original file line number Diff line number Diff line change 14
14
"strictNullChecks" : true
15
15
},
16
16
"include" : [" src/**/*" ],
17
- "exclude" : [" src/**/*.test .ts" ]
17
+ "exclude" : [" src/**/*.spec .ts" ]
18
18
}
You can’t perform that action at this time.
0 commit comments