wikitext 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/ext/wikitext_ragel.c CHANGED
@@ -655,11 +655,10 @@ case 94:
655
655
  case 35: goto tr116;
656
656
  case 38: goto tr118;
657
657
  case 39: goto st100;
658
- case 41: goto st97;
659
658
  case 42: goto tr120;
660
- case 44: goto st97;
661
- case 45: goto tr121;
659
+ case 43: goto st98;
662
660
  case 46: goto tr122;
661
+ case 47: goto st98;
663
662
  case 60: goto tr123;
664
663
  case 61: goto tr124;
665
664
  case 62: goto tr125;
@@ -683,19 +682,22 @@ case 94:
683
682
  case 126: goto st98;
684
683
  case 127: goto tr110;
685
684
  }
686
- if ( (*p) < 1 ) {
685
+ if ( (*p) < 36 ) {
687
686
  if ( (*p) < -32 ) {
688
687
  if ( -62 <= (*p) && (*p) <= -33 )
689
688
  goto st1;
690
689
  } else if ( (*p) > -17 ) {
691
- if ( -16 <= (*p) && (*p) <= -12 )
690
+ if ( (*p) > -12 ) {
691
+ if ( 1 <= (*p) && (*p) <= 31 )
692
+ goto tr110;
693
+ } else if ( (*p) >= -16 )
692
694
  goto st4;
693
695
  } else
694
696
  goto st2;
695
- } else if ( (*p) > 31 ) {
696
- if ( (*p) < 48 ) {
697
- if ( 36 <= (*p) && (*p) <= 47 )
698
- goto st98;
697
+ } else if ( (*p) > 37 ) {
698
+ if ( (*p) < 45 ) {
699
+ if ( 40 <= (*p) && (*p) <= 44 )
700
+ goto st97;
699
701
  } else if ( (*p) > 57 ) {
700
702
  if ( (*p) > 63 ) {
701
703
  if ( 65 <= (*p) && (*p) <= 122 )
@@ -705,7 +707,7 @@ case 94:
705
707
  } else
706
708
  goto tr121;
707
709
  } else
708
- goto tr110;
710
+ goto st98;
709
711
  goto st0;
710
712
  st0:
711
713
  cs = 0;
@@ -762,7 +764,7 @@ st95:
762
764
  if ( ++p == pe )
763
765
  goto _test_eof95;
764
766
  case 95:
765
- #line 766 "wikitext_ragel.c"
767
+ #line 768 "wikitext_ragel.c"
766
768
  if ( (*p) == 10 )
767
769
  goto tr137;
768
770
  goto tr136;
@@ -776,7 +778,7 @@ st96:
776
778
  if ( ++p == pe )
777
779
  goto _test_eof96;
778
780
  case 96:
779
- #line 780 "wikitext_ragel.c"
781
+ #line 782 "wikitext_ragel.c"
780
782
  if ( (*p) == 32 )
781
783
  goto st96;
782
784
  goto tr138;
@@ -786,12 +788,14 @@ st97:
786
788
  case 97:
787
789
  switch( (*p) ) {
788
790
  case 33: goto st97;
789
- case 41: goto st97;
790
791
  case 44: goto st97;
791
792
  case 46: goto st97;
792
793
  case 63: goto st97;
793
794
  }
794
- if ( 58 <= (*p) && (*p) <= 59 )
795
+ if ( (*p) > 41 ) {
796
+ if ( 58 <= (*p) && (*p) <= 59 )
797
+ goto st97;
798
+ } else if ( (*p) >= 40 )
795
799
  goto st97;
796
800
  goto tr140;
797
801
  st98:
@@ -799,7 +803,6 @@ st98:
799
803
  goto _test_eof98;
800
804
  case 98:
801
805
  switch( (*p) ) {
802
- case 40: goto st98;
803
806
  case 43: goto st98;
804
807
  case 45: goto st98;
805
808
  case 92: goto st98;
@@ -828,7 +831,7 @@ st99:
828
831
  if ( ++p == pe )
829
832
  goto _test_eof99;
830
833
  case 99:
831
- #line 832 "wikitext_ragel.c"
834
+ #line 835 "wikitext_ragel.c"
832
835
  switch( (*p) ) {
833
836
  case 35: goto st7;
834
837
  case 97: goto st13;
@@ -1065,9 +1068,8 @@ st104:
1065
1068
  if ( ++p == pe )
1066
1069
  goto _test_eof104;
1067
1070
  case 104:
1068
- #line 1069 "wikitext_ragel.c"
1071
+ #line 1072 "wikitext_ragel.c"
1069
1072
  switch( (*p) ) {
1070
- case 40: goto st98;
1071
1073
  case 43: goto st98;
1072
1074
  case 46: goto st20;
1073
1075
  case 47: goto st98;
@@ -1175,7 +1177,7 @@ st105:
1175
1177
  if ( ++p == pe )
1176
1178
  goto _test_eof105;
1177
1179
  case 105:
1178
- #line 1179 "wikitext_ragel.c"
1180
+ #line 1181 "wikitext_ragel.c"
1179
1181
  if ( (*p) == 46 )
1180
1182
  goto st23;
1181
1183
  if ( (*p) < 65 ) {
@@ -1197,7 +1199,7 @@ st106:
1197
1199
  if ( ++p == pe )
1198
1200
  goto _test_eof106;
1199
1201
  case 106:
1200
- #line 1201 "wikitext_ragel.c"
1202
+ #line 1203 "wikitext_ragel.c"
1201
1203
  if ( (*p) == 46 )
1202
1204
  goto st23;
1203
1205
  if ( (*p) < 65 ) {
@@ -1219,7 +1221,7 @@ st107:
1219
1221
  if ( ++p == pe )
1220
1222
  goto _test_eof107;
1221
1223
  case 107:
1222
- #line 1223 "wikitext_ragel.c"
1224
+ #line 1225 "wikitext_ragel.c"
1223
1225
  if ( (*p) == 46 )
1224
1226
  goto st23;
1225
1227
  if ( (*p) < 65 ) {
@@ -1241,7 +1243,7 @@ st108:
1241
1243
  if ( ++p == pe )
1242
1244
  goto _test_eof108;
1243
1245
  case 108:
1244
- #line 1245 "wikitext_ragel.c"
1246
+ #line 1247 "wikitext_ragel.c"
1245
1247
  if ( (*p) == 46 )
1246
1248
  goto st23;
1247
1249
  if ( (*p) < 65 ) {
@@ -1258,7 +1260,6 @@ st109:
1258
1260
  goto _test_eof109;
1259
1261
  case 109:
1260
1262
  switch( (*p) ) {
1261
- case 40: goto st98;
1262
1263
  case 43: goto st98;
1263
1264
  case 45: goto st98;
1264
1265
  case 47: goto st98;
@@ -1291,9 +1292,8 @@ st110:
1291
1292
  if ( ++p == pe )
1292
1293
  goto _test_eof110;
1293
1294
  case 110:
1294
- #line 1295 "wikitext_ragel.c"
1295
+ #line 1296 "wikitext_ragel.c"
1295
1296
  switch( (*p) ) {
1296
- case 40: goto st98;
1297
1297
  case 43: goto st98;
1298
1298
  case 46: goto st23;
1299
1299
  case 64: goto st98;
@@ -1331,7 +1331,6 @@ case 111:
1331
1331
  #line 1332 "wikitext_ragel.c"
1332
1332
  switch( (*p) ) {
1333
1333
  case 33: goto st97;
1334
- case 41: goto st97;
1335
1334
  case 44: goto st97;
1336
1335
  case 45: goto st20;
1337
1336
  case 46: goto tr122;
@@ -1340,8 +1339,11 @@ case 111:
1340
1339
  case 95: goto st20;
1341
1340
  }
1342
1341
  if ( (*p) < 58 ) {
1343
- if ( 48 <= (*p) && (*p) <= 57 )
1344
- goto st20;
1342
+ if ( (*p) > 41 ) {
1343
+ if ( 48 <= (*p) && (*p) <= 57 )
1344
+ goto st20;
1345
+ } else if ( (*p) >= 40 )
1346
+ goto st97;
1345
1347
  } else if ( (*p) > 59 ) {
1346
1348
  if ( (*p) > 90 ) {
1347
1349
  if ( 97 <= (*p) && (*p) <= 122 )
@@ -1359,7 +1361,7 @@ st112:
1359
1361
  if ( ++p == pe )
1360
1362
  goto _test_eof112;
1361
1363
  case 112:
1362
- #line 1363 "wikitext_ragel.c"
1364
+ #line 1365 "wikitext_ragel.c"
1363
1365
  switch( (*p) ) {
1364
1366
  case 47: goto st25;
1365
1367
  case 66: goto st55;
@@ -1903,7 +1905,7 @@ st113:
1903
1905
  if ( ++p == pe )
1904
1906
  goto _test_eof113;
1905
1907
  case 113:
1906
- #line 1907 "wikitext_ragel.c"
1908
+ #line 1909 "wikitext_ragel.c"
1907
1909
  switch( (*p) ) {
1908
1910
  case 32: goto st114;
1909
1911
  case 61: goto tr124;
@@ -1926,7 +1928,7 @@ st115:
1926
1928
  if ( ++p == pe )
1927
1929
  goto _test_eof115;
1928
1930
  case 115:
1929
- #line 1930 "wikitext_ragel.c"
1931
+ #line 1932 "wikitext_ragel.c"
1930
1932
  if ( (*p) == 32 )
1931
1933
  goto tr168;
1932
1934
  goto tr167;
@@ -1940,9 +1942,8 @@ st116:
1940
1942
  if ( ++p == pe )
1941
1943
  goto _test_eof116;
1942
1944
  case 116:
1943
- #line 1944 "wikitext_ragel.c"
1945
+ #line 1946 "wikitext_ragel.c"
1944
1946
  switch( (*p) ) {
1945
- case 40: goto st98;
1946
1947
  case 43: goto st98;
1947
1948
  case 46: goto st20;
1948
1949
  case 47: goto st98;
@@ -1976,9 +1977,8 @@ st117:
1976
1977
  if ( ++p == pe )
1977
1978
  goto _test_eof117;
1978
1979
  case 117:
1979
- #line 1980 "wikitext_ragel.c"
1980
+ #line 1981 "wikitext_ragel.c"
1980
1981
  switch( (*p) ) {
1981
- case 40: goto st98;
1982
1982
  case 43: goto st98;
1983
1983
  case 46: goto st20;
1984
1984
  case 47: goto st98;
@@ -2014,7 +2014,6 @@ st118:
2014
2014
  case 118:
2015
2015
  #line 2016 "wikitext_ragel.c"
2016
2016
  switch( (*p) ) {
2017
- case 40: goto st98;
2018
2017
  case 43: goto st98;
2019
2018
  case 46: goto st20;
2020
2019
  case 47: goto st98;
@@ -2084,7 +2083,7 @@ st119:
2084
2083
  if ( ++p == pe )
2085
2084
  goto _test_eof119;
2086
2085
  case 119:
2087
- #line 2088 "wikitext_ragel.c"
2086
+ #line 2087 "wikitext_ragel.c"
2088
2087
  switch( (*p) ) {
2089
2088
  case 33: goto st87;
2090
2089
  case 41: goto st87;
@@ -2143,9 +2142,8 @@ st120:
2143
2142
  if ( ++p == pe )
2144
2143
  goto _test_eof120;
2145
2144
  case 120:
2146
- #line 2147 "wikitext_ragel.c"
2145
+ #line 2146 "wikitext_ragel.c"
2147
2146
  switch( (*p) ) {
2148
- case 40: goto st98;
2149
2147
  case 43: goto st98;
2150
2148
  case 46: goto st20;
2151
2149
  case 47: goto st98;
@@ -2179,9 +2177,8 @@ st121:
2179
2177
  if ( ++p == pe )
2180
2178
  goto _test_eof121;
2181
2179
  case 121:
2182
- #line 2183 "wikitext_ragel.c"
2180
+ #line 2181 "wikitext_ragel.c"
2183
2181
  switch( (*p) ) {
2184
- case 40: goto st98;
2185
2182
  case 43: goto st98;
2186
2183
  case 46: goto st20;
2187
2184
  case 47: goto st98;
@@ -2215,9 +2212,8 @@ st122:
2215
2212
  if ( ++p == pe )
2216
2213
  goto _test_eof122;
2217
2214
  case 122:
2218
- #line 2219 "wikitext_ragel.c"
2215
+ #line 2216 "wikitext_ragel.c"
2219
2216
  switch( (*p) ) {
2220
- case 40: goto st98;
2221
2217
  case 43: goto st98;
2222
2218
  case 46: goto st20;
2223
2219
  case 47: goto st98;
@@ -2251,9 +2247,8 @@ st123:
2251
2247
  if ( ++p == pe )
2252
2248
  goto _test_eof123;
2253
2249
  case 123:
2254
- #line 2255 "wikitext_ragel.c"
2250
+ #line 2251 "wikitext_ragel.c"
2255
2251
  switch( (*p) ) {
2256
- case 40: goto st98;
2257
2252
  case 43: goto st98;
2258
2253
  case 46: goto st20;
2259
2254
  case 47: goto st98;
@@ -2288,9 +2283,8 @@ st124:
2288
2283
  if ( ++p == pe )
2289
2284
  goto _test_eof124;
2290
2285
  case 124:
2291
- #line 2292 "wikitext_ragel.c"
2286
+ #line 2287 "wikitext_ragel.c"
2292
2287
  switch( (*p) ) {
2293
- case 40: goto st98;
2294
2288
  case 43: goto st98;
2295
2289
  case 46: goto st20;
2296
2290
  case 47: goto st98;
@@ -2324,9 +2318,8 @@ st125:
2324
2318
  if ( ++p == pe )
2325
2319
  goto _test_eof125;
2326
2320
  case 125:
2327
- #line 2328 "wikitext_ragel.c"
2321
+ #line 2322 "wikitext_ragel.c"
2328
2322
  switch( (*p) ) {
2329
- case 40: goto st98;
2330
2323
  case 43: goto st98;
2331
2324
  case 46: goto st20;
2332
2325
  case 47: goto st98;
@@ -2360,9 +2353,8 @@ st126:
2360
2353
  if ( ++p == pe )
2361
2354
  goto _test_eof126;
2362
2355
  case 126:
2363
- #line 2364 "wikitext_ragel.c"
2356
+ #line 2357 "wikitext_ragel.c"
2364
2357
  switch( (*p) ) {
2365
- case 40: goto st98;
2366
2358
  case 43: goto st98;
2367
2359
  case 46: goto st20;
2368
2360
  case 47: goto st98;
@@ -2396,9 +2388,8 @@ st127:
2396
2388
  if ( ++p == pe )
2397
2389
  goto _test_eof127;
2398
2390
  case 127:
2399
- #line 2400 "wikitext_ragel.c"
2391
+ #line 2392 "wikitext_ragel.c"
2400
2392
  switch( (*p) ) {
2401
- case 40: goto st98;
2402
2393
  case 43: goto st98;
2403
2394
  case 46: goto st20;
2404
2395
  case 47: goto st98;
@@ -2432,9 +2423,8 @@ st128:
2432
2423
  if ( ++p == pe )
2433
2424
  goto _test_eof128;
2434
2425
  case 128:
2435
- #line 2436 "wikitext_ragel.c"
2426
+ #line 2427 "wikitext_ragel.c"
2436
2427
  switch( (*p) ) {
2437
- case 40: goto st98;
2438
2428
  case 43: goto st98;
2439
2429
  case 46: goto st20;
2440
2430
  case 47: goto st98;
@@ -2468,9 +2458,8 @@ st129:
2468
2458
  if ( ++p == pe )
2469
2459
  goto _test_eof129;
2470
2460
  case 129:
2471
- #line 2472 "wikitext_ragel.c"
2461
+ #line 2462 "wikitext_ragel.c"
2472
2462
  switch( (*p) ) {
2473
- case 40: goto st98;
2474
2463
  case 43: goto st98;
2475
2464
  case 46: goto st20;
2476
2465
  case 47: goto st98;
@@ -2597,7 +2586,7 @@ st130:
2597
2586
  if ( ++p == pe )
2598
2587
  goto _test_eof130;
2599
2588
  case 130:
2600
- #line 2601 "wikitext_ragel.c"
2589
+ #line 2590 "wikitext_ragel.c"
2601
2590
  if ( (*p) == 46 )
2602
2591
  goto st92;
2603
2592
  if ( (*p) < 65 ) {
@@ -2619,7 +2608,7 @@ st131:
2619
2608
  if ( ++p == pe )
2620
2609
  goto _test_eof131;
2621
2610
  case 131:
2622
- #line 2623 "wikitext_ragel.c"
2611
+ #line 2612 "wikitext_ragel.c"
2623
2612
  if ( (*p) == 46 )
2624
2613
  goto st92;
2625
2614
  if ( (*p) < 65 ) {
@@ -2641,7 +2630,7 @@ st132:
2641
2630
  if ( ++p == pe )
2642
2631
  goto _test_eof132;
2643
2632
  case 132:
2644
- #line 2645 "wikitext_ragel.c"
2633
+ #line 2634 "wikitext_ragel.c"
2645
2634
  if ( (*p) == 46 )
2646
2635
  goto st92;
2647
2636
  if ( (*p) < 65 ) {
@@ -2663,7 +2652,7 @@ st133:
2663
2652
  if ( ++p == pe )
2664
2653
  goto _test_eof133;
2665
2654
  case 133:
2666
- #line 2667 "wikitext_ragel.c"
2655
+ #line 2656 "wikitext_ragel.c"
2667
2656
  if ( (*p) == 46 )
2668
2657
  goto st92;
2669
2658
  if ( (*p) < 65 ) {
@@ -2685,9 +2674,8 @@ st134:
2685
2674
  if ( ++p == pe )
2686
2675
  goto _test_eof134;
2687
2676
  case 134:
2688
- #line 2689 "wikitext_ragel.c"
2677
+ #line 2678 "wikitext_ragel.c"
2689
2678
  switch( (*p) ) {
2690
- case 40: goto st98;
2691
2679
  case 43: goto st98;
2692
2680
  case 46: goto st20;
2693
2681
  case 47: goto st98;
@@ -2721,9 +2709,8 @@ st135:
2721
2709
  if ( ++p == pe )
2722
2710
  goto _test_eof135;
2723
2711
  case 135:
2724
- #line 2725 "wikitext_ragel.c"
2712
+ #line 2713 "wikitext_ragel.c"
2725
2713
  switch( (*p) ) {
2726
- case 40: goto st98;
2727
2714
  case 43: goto st98;
2728
2715
  case 46: goto st20;
2729
2716
  case 47: goto st98;
@@ -13,5 +13,5 @@
13
13
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
14
14
 
15
15
  module Wikitext
16
- VERSION = '1.0.1'
16
+ VERSION = '1.0.2'
17
17
  end # module Wikitext
@@ -580,5 +580,21 @@ describe Wikitext::Parser, 'autolinking' do
580
580
  @parser.parse(input).should == expected
581
581
  end
582
582
  end
583
+
584
+ describe 'before HTTP URIs' do
585
+ it 'should handle left parenthesis before' do
586
+ input = "The site (http://example.com/)"
587
+ expected = %Q{<p>The site (<a href="http://example.com/" class="external">http://example.com/</a>)</p>\n}
588
+ @parser.parse(input).should == expected
589
+ end
590
+ end
591
+
592
+ describe 'before email addresses' do
593
+ it 'should handle left parenthesis before' do
594
+ input = "Email me (user@example.com)"
595
+ expected = %Q{<p>Email me (<a href="mailto:user@example.com" class="mailto">user@example.com</a>)</p>\n}
596
+ @parser.parse(input).should == expected
597
+ end
598
+ end
583
599
  end
584
600
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikitext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wincent Colaiuta
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-24 00:00:00 +01:00
12
+ date: 2008-03-27 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15