RedCloth 4.2.9 → 4.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +40 -3
- data/Gemfile +3 -3
- data/README.rdoc +29 -36
- data/Rakefile +1 -2
- data/ext/redcloth_scan/extconf.rb +0 -1
- data/ext/redcloth_scan/redcloth_inline.c +4 -4
- data/ext/redcloth_scan/redcloth_scan.c +77 -77
- data/lib/redcloth/formatters/base.rb +1 -1
- data/lib/redcloth/formatters/html.rb +15 -7
- data/lib/redcloth/formatters/latex.rb +6 -4
- data/lib/redcloth/version.rb +7 -7
- data/lib/redcloth.rb +5 -0
- data/redcloth.gemspec +22 -28
- data/spec/custom_tags_spec.rb +7 -7
- data/spec/erb_spec.rb +1 -1
- data/spec/extension_spec.rb +1 -1
- data/spec/fixtures/threshold.yml +1 -1
- data/spec/formatters/html_spec.rb +2 -2
- data/spec/formatters/latex_spec.rb +2 -2
- data/spec/parser_spec.rb +8 -7
- data/spec/security/CVE-2012-6684_spec.rb +33 -0
- data/spec/security/CVE-2023-31606_spec.rb +49 -0
- data/spec/spec_helper.rb +4 -4
- data/tasks/compile.rake +7 -16
- data/tasks/ragel_extension_task.rb +1 -12
- data/tasks/release.rake +11 -11
- data/tasks/rvm.rake +5 -3
- metadata +101 -151
- data/lib/redcloth_scan.jar +0 -0
- data/tasks/gems.rake +0 -37
@@ -23459,7 +23459,7 @@ _eof_trans:
|
|
23459
23459
|
break;
|
23460
23460
|
case 58:
|
23461
23461
|
#line 150 "ragel/redcloth_scan.rl"
|
23462
|
-
{ SET_ATTRIBUTES(); {cs = 2479;
|
23462
|
+
{ SET_ATTRIBUTES(); {cs = 2479;goto _again;} }
|
23463
23463
|
break;
|
23464
23464
|
case 61:
|
23465
23465
|
#line 1 "NONE"
|
@@ -23467,7 +23467,7 @@ _eof_trans:
|
|
23467
23467
|
break;
|
23468
23468
|
case 62:
|
23469
23469
|
#line 72 "ragel/redcloth_scan.rl"
|
23470
|
-
{te = p+1;{ CAT(block); DONE(block); {cs = 2250;
|
23470
|
+
{te = p+1;{ CAT(block); DONE(block); {cs = 2250;goto _again;} }}
|
23471
23471
|
break;
|
23472
23472
|
case 63:
|
23473
23473
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23475,7 +23475,7 @@ _eof_trans:
|
|
23475
23475
|
break;
|
23476
23476
|
case 64:
|
23477
23477
|
#line 72 "ragel/redcloth_scan.rl"
|
23478
|
-
{te = p;p--;{ CAT(block); DONE(block); {cs = 2250;
|
23478
|
+
{te = p;p--;{ CAT(block); DONE(block); {cs = 2250;goto _again;} }}
|
23479
23479
|
break;
|
23480
23480
|
case 65:
|
23481
23481
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23499,15 +23499,15 @@ _eof_trans:
|
|
23499
23499
|
break;
|
23500
23500
|
case 70:
|
23501
23501
|
#line 77 "ragel/redcloth_scan.rl"
|
23502
|
-
{te = p+1;{ ADD_BLOCKCODE(); {cs = 2250;
|
23502
|
+
{te = p+1;{ ADD_BLOCKCODE(); {cs = 2250;goto _again;} }}
|
23503
23503
|
break;
|
23504
23504
|
case 71:
|
23505
23505
|
#line 80 "ragel/redcloth_scan.rl"
|
23506
|
-
{te = p+1;{ ADD_EXTENDED_BLOCKCODE(); END_EXTENDED(); {cs = 2250;
|
23506
|
+
{te = p+1;{ ADD_EXTENDED_BLOCKCODE(); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23507
23507
|
break;
|
23508
23508
|
case 72:
|
23509
23509
|
#line 81 "ragel/redcloth_scan.rl"
|
23510
|
-
{te = p+1;{ ADD_BLOCKCODE(); {cs = 2250;
|
23510
|
+
{te = p+1;{ ADD_BLOCKCODE(); {cs = 2250;goto _again;} }}
|
23511
23511
|
break;
|
23512
23512
|
case 73:
|
23513
23513
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23519,7 +23519,7 @@ _eof_trans:
|
|
23519
23519
|
break;
|
23520
23520
|
case 75:
|
23521
23521
|
#line 79 "ragel/redcloth_scan.rl"
|
23522
|
-
{te = p;p--;{ ADD_BLOCKCODE(); {cs = 2250;
|
23522
|
+
{te = p;p--;{ ADD_BLOCKCODE(); {cs = 2250;goto _again;} }}
|
23523
23523
|
break;
|
23524
23524
|
case 76:
|
23525
23525
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23536,7 +23536,7 @@ _eof_trans:
|
|
23536
23536
|
{{p = ((te))-1;} ADD_EXTENDED_BLOCKCODE(); }
|
23537
23537
|
break;
|
23538
23538
|
case 5:
|
23539
|
-
{{p = ((te))-1;} ADD_BLOCKCODE(); {cs = 2250;
|
23539
|
+
{{p = ((te))-1;} ADD_BLOCKCODE(); {cs = 2250;goto _again;} }
|
23540
23540
|
break;
|
23541
23541
|
case 8:
|
23542
23542
|
{{p = ((te))-1;} rb_str_cat_escaped_for_preformatted(self, block, ts, te); }
|
@@ -23546,11 +23546,11 @@ _eof_trans:
|
|
23546
23546
|
break;
|
23547
23547
|
case 79:
|
23548
23548
|
#line 86 "ragel/redcloth_scan.rl"
|
23549
|
-
{te = p+1;{ CAT(block); ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;
|
23549
|
+
{te = p+1;{ CAT(block); ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23550
23550
|
break;
|
23551
23551
|
case 80:
|
23552
23552
|
#line 87 "ragel/redcloth_scan.rl"
|
23553
|
-
{te = p+1;{ ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;
|
23553
|
+
{te = p+1;{ ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23554
23554
|
break;
|
23555
23555
|
case 81:
|
23556
23556
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23558,7 +23558,7 @@ _eof_trans:
|
|
23558
23558
|
break;
|
23559
23559
|
case 82:
|
23560
23560
|
#line 86 "ragel/redcloth_scan.rl"
|
23561
|
-
{te = p;p--;{ CAT(block); ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;
|
23561
|
+
{te = p;p--;{ CAT(block); ASET("type", "ignore"); ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23562
23562
|
break;
|
23563
23563
|
case 83:
|
23564
23564
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23570,7 +23570,7 @@ _eof_trans:
|
|
23570
23570
|
break;
|
23571
23571
|
case 85:
|
23572
23572
|
#line 92 "ragel/redcloth_scan.rl"
|
23573
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23573
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23574
23574
|
break;
|
23575
23575
|
case 86:
|
23576
23576
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23590,15 +23590,15 @@ _eof_trans:
|
|
23590
23590
|
break;
|
23591
23591
|
case 90:
|
23592
23592
|
#line 97 "ragel/redcloth_scan.rl"
|
23593
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23593
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23594
23594
|
break;
|
23595
23595
|
case 91:
|
23596
23596
|
#line 100 "ragel/redcloth_scan.rl"
|
23597
|
-
{te = p+1;{ CAT(block); ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;
|
23597
|
+
{te = p+1;{ CAT(block); ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23598
23598
|
break;
|
23599
23599
|
case 92:
|
23600
23600
|
#line 101 "ragel/redcloth_scan.rl"
|
23601
|
-
{te = p+1;{ ADD_BLOCK(); CAT(html); {cs = 2250;
|
23601
|
+
{te = p+1;{ ADD_BLOCK(); CAT(html); {cs = 2250;goto _again;} }}
|
23602
23602
|
break;
|
23603
23603
|
case 93:
|
23604
23604
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23610,7 +23610,7 @@ _eof_trans:
|
|
23610
23610
|
break;
|
23611
23611
|
case 95:
|
23612
23612
|
#line 99 "ragel/redcloth_scan.rl"
|
23613
|
-
{te = p;p--;{ ADD_BLOCK(); CAT(html); {cs = 2250;
|
23613
|
+
{te = p;p--;{ ADD_BLOCK(); CAT(html); {cs = 2250;goto _again;} }}
|
23614
23614
|
break;
|
23615
23615
|
case 96:
|
23616
23616
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23627,7 +23627,7 @@ _eof_trans:
|
|
23627
23627
|
{{p = ((te))-1;} CAT(block); ADD_EXTENDED_BLOCK(); CAT(html); }
|
23628
23628
|
break;
|
23629
23629
|
case 16:
|
23630
|
-
{{p = ((te))-1;} ADD_BLOCK(); CAT(html); {cs = 2250;
|
23630
|
+
{{p = ((te))-1;} ADD_BLOCK(); CAT(html); {cs = 2250;goto _again;} }
|
23631
23631
|
break;
|
23632
23632
|
case 19:
|
23633
23633
|
{{p = ((te))-1;} CAT(block); }
|
@@ -23641,7 +23641,7 @@ _eof_trans:
|
|
23641
23641
|
break;
|
23642
23642
|
case 100:
|
23643
23643
|
#line 106 "ragel/redcloth_scan.rl"
|
23644
|
-
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;
|
23644
|
+
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23645
23645
|
break;
|
23646
23646
|
case 101:
|
23647
23647
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23665,15 +23665,15 @@ _eof_trans:
|
|
23665
23665
|
break;
|
23666
23666
|
case 106:
|
23667
23667
|
#line 111 "ragel/redcloth_scan.rl"
|
23668
|
-
{te = p+1;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;
|
23668
|
+
{te = p+1;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;goto _again;} }}
|
23669
23669
|
break;
|
23670
23670
|
case 107:
|
23671
23671
|
#line 114 "ragel/redcloth_scan.rl"
|
23672
|
-
{te = p+1;{ ADD_EXTENDED_BLOCKCODE(); CAT(html); RSTRIP_BANG(html); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); END_EXTENDED(); {cs = 2250;
|
23672
|
+
{te = p+1;{ ADD_EXTENDED_BLOCKCODE(); CAT(html); RSTRIP_BANG(html); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23673
23673
|
break;
|
23674
23674
|
case 108:
|
23675
23675
|
#line 115 "ragel/redcloth_scan.rl"
|
23676
|
-
{te = p+1;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;
|
23676
|
+
{te = p+1;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;goto _again;} }}
|
23677
23677
|
break;
|
23678
23678
|
case 109:
|
23679
23679
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23685,7 +23685,7 @@ _eof_trans:
|
|
23685
23685
|
break;
|
23686
23686
|
case 111:
|
23687
23687
|
#line 113 "ragel/redcloth_scan.rl"
|
23688
|
-
{te = p;p--;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;
|
23688
|
+
{te = p;p--;{ ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;goto _again;} }}
|
23689
23689
|
break;
|
23690
23690
|
case 112:
|
23691
23691
|
#line 6 "ragel/redcloth_common.c.rl"
|
@@ -23702,7 +23702,7 @@ _eof_trans:
|
|
23702
23702
|
{{p = ((te))-1;} ADD_EXTENDED_BLOCKCODE(); CAT(html); }
|
23703
23703
|
break;
|
23704
23704
|
case 24:
|
23705
|
-
{{p = ((te))-1;} ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;
|
23705
|
+
{{p = ((te))-1;} ADD_BLOCKCODE(); INLINE(html, "bc_close"); SET_PLAIN_BLOCK("p"); {cs = 2250;goto _again;} }
|
23706
23706
|
break;
|
23707
23707
|
case 27:
|
23708
23708
|
{{p = ((te))-1;} rb_str_cat_escaped_for_preformatted(self, block, ts, te); }
|
@@ -23724,23 +23724,23 @@ _eof_trans:
|
|
23724
23724
|
break;
|
23725
23725
|
case 118:
|
23726
23726
|
#line 120 "ragel/redcloth_scan.rl"
|
23727
|
-
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;
|
23727
|
+
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;goto _again;} }}
|
23728
23728
|
break;
|
23729
23729
|
case 119:
|
23730
23730
|
#line 123 "ragel/redcloth_scan.rl"
|
23731
|
-
{te = p+1;{ ADD_EXTENDED_BLOCK(); INLINE(html, "bq_close"); END_EXTENDED(); {cs = 2250;
|
23731
|
+
{te = p+1;{ ADD_EXTENDED_BLOCK(); INLINE(html, "bq_close"); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23732
23732
|
break;
|
23733
23733
|
case 120:
|
23734
23734
|
#line 124 "ragel/redcloth_scan.rl"
|
23735
|
-
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;
|
23735
|
+
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;goto _again;} }}
|
23736
23736
|
break;
|
23737
23737
|
case 121:
|
23738
23738
|
#line 125 "ragel/redcloth_scan.rl"
|
23739
|
-
{te = p+1;{ ADD_EXTENDED_BLOCK(); INLINE(html, "bq_close"); END_EXTENDED(); {cs = 2250;
|
23739
|
+
{te = p+1;{ ADD_EXTENDED_BLOCK(); INLINE(html, "bq_close"); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23740
23740
|
break;
|
23741
23741
|
case 122:
|
23742
23742
|
#line 126 "ragel/redcloth_scan.rl"
|
23743
|
-
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;
|
23743
|
+
{te = p+1;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;goto _again;} }}
|
23744
23744
|
break;
|
23745
23745
|
case 123:
|
23746
23746
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23752,7 +23752,7 @@ _eof_trans:
|
|
23752
23752
|
break;
|
23753
23753
|
case 125:
|
23754
23754
|
#line 122 "ragel/redcloth_scan.rl"
|
23755
|
-
{te = p;p--;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;
|
23755
|
+
{te = p;p--;{ ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;goto _again;} }}
|
23756
23756
|
break;
|
23757
23757
|
case 126:
|
23758
23758
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23769,7 +23769,7 @@ _eof_trans:
|
|
23769
23769
|
{{p = ((te))-1;} ADD_EXTENDED_BLOCK(); }
|
23770
23770
|
break;
|
23771
23771
|
case 30:
|
23772
|
-
{{p = ((te))-1;} ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;
|
23772
|
+
{{p = ((te))-1;} ADD_BLOCK(); INLINE(html, "bq_close"); {cs = 2250;goto _again;} }
|
23773
23773
|
break;
|
23774
23774
|
case 35:
|
23775
23775
|
{{p = ((te))-1;} CAT(block); }
|
@@ -23795,23 +23795,23 @@ _eof_trans:
|
|
23795
23795
|
break;
|
23796
23796
|
case 133:
|
23797
23797
|
#line 131 "ragel/redcloth_scan.rl"
|
23798
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23798
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23799
23799
|
break;
|
23800
23800
|
case 134:
|
23801
23801
|
#line 134 "ragel/redcloth_scan.rl"
|
23802
|
-
{te = p+1;{ ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;
|
23802
|
+
{te = p+1;{ ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23803
23803
|
break;
|
23804
23804
|
case 135:
|
23805
23805
|
#line 135 "ragel/redcloth_scan.rl"
|
23806
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23806
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23807
23807
|
break;
|
23808
23808
|
case 136:
|
23809
23809
|
#line 136 "ragel/redcloth_scan.rl"
|
23810
|
-
{te = p+1;{ ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;
|
23810
|
+
{te = p+1;{ ADD_EXTENDED_BLOCK(); END_EXTENDED(); {cs = 2250;goto _again;} }}
|
23811
23811
|
break;
|
23812
23812
|
case 137:
|
23813
23813
|
#line 137 "ragel/redcloth_scan.rl"
|
23814
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23814
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23815
23815
|
break;
|
23816
23816
|
case 138:
|
23817
23817
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23823,11 +23823,11 @@ _eof_trans:
|
|
23823
23823
|
break;
|
23824
23824
|
case 140:
|
23825
23825
|
#line 133 "ragel/redcloth_scan.rl"
|
23826
|
-
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;
|
23826
|
+
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23827
23827
|
break;
|
23828
23828
|
case 141:
|
23829
23829
|
#line 138 "ragel/redcloth_scan.rl"
|
23830
|
-
{te = p;p--;{ ADD_BLOCK(); CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;
|
23830
|
+
{te = p;p--;{ ADD_BLOCK(); CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;goto _again;} }}
|
23831
23831
|
break;
|
23832
23832
|
case 142:
|
23833
23833
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23844,10 +23844,10 @@ _eof_trans:
|
|
23844
23844
|
{{p = ((te))-1;} ADD_EXTENDED_BLOCK(); }
|
23845
23845
|
break;
|
23846
23846
|
case 38:
|
23847
|
-
{{p = ((te))-1;} ADD_BLOCK(); {cs = 2250;
|
23847
|
+
{{p = ((te))-1;} ADD_BLOCK(); {cs = 2250;goto _again;} }
|
23848
23848
|
break;
|
23849
23849
|
case 43:
|
23850
|
-
{{p = ((te))-1;} ADD_BLOCK(); CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;
|
23850
|
+
{{p = ((te))-1;} ADD_BLOCK(); CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;goto _again;} }
|
23851
23851
|
break;
|
23852
23852
|
case 44:
|
23853
23853
|
{{p = ((te))-1;} CAT(block); }
|
@@ -23857,7 +23857,7 @@ _eof_trans:
|
|
23857
23857
|
break;
|
23858
23858
|
case 145:
|
23859
23859
|
#line 144 "ragel/redcloth_scan.rl"
|
23860
|
-
{te = p+1;{ ADD_BLOCK(); {cs = 2250;
|
23860
|
+
{te = p+1;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23861
23861
|
break;
|
23862
23862
|
case 146:
|
23863
23863
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23865,7 +23865,7 @@ _eof_trans:
|
|
23865
23865
|
break;
|
23866
23866
|
case 147:
|
23867
23867
|
#line 144 "ragel/redcloth_scan.rl"
|
23868
|
-
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;
|
23868
|
+
{te = p;p--;{ ADD_BLOCK(); {cs = 2250;goto _again;} }}
|
23869
23869
|
break;
|
23870
23870
|
case 148:
|
23871
23871
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23885,7 +23885,7 @@ _eof_trans:
|
|
23885
23885
|
break;
|
23886
23886
|
case 152:
|
23887
23887
|
#line 154 "ragel/redcloth_scan.rl"
|
23888
|
-
{te = p+1;{ ADD_BLOCK(); RESET_NEST(); LIST_LAYOUT(); {cs = 2250;
|
23888
|
+
{te = p+1;{ ADD_BLOCK(); RESET_NEST(); LIST_LAYOUT(); {cs = 2250;goto _again;} }}
|
23889
23889
|
break;
|
23890
23890
|
case 153:
|
23891
23891
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23893,11 +23893,11 @@ _eof_trans:
|
|
23893
23893
|
break;
|
23894
23894
|
case 154:
|
23895
23895
|
#line 153 "ragel/redcloth_scan.rl"
|
23896
|
-
{te = p;p--;{ ADD_BLOCK(); LIST_LAYOUT(); {cs = 2159;
|
23896
|
+
{te = p;p--;{ ADD_BLOCK(); LIST_LAYOUT(); {cs = 2159;goto _again;} }}
|
23897
23897
|
break;
|
23898
23898
|
case 155:
|
23899
23899
|
#line 154 "ragel/redcloth_scan.rl"
|
23900
|
-
{te = p;p--;{ ADD_BLOCK(); RESET_NEST(); LIST_LAYOUT(); {cs = 2250;
|
23900
|
+
{te = p;p--;{ ADD_BLOCK(); RESET_NEST(); LIST_LAYOUT(); {cs = 2250;goto _again;} }}
|
23901
23901
|
break;
|
23902
23902
|
case 156:
|
23903
23903
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23911,7 +23911,7 @@ _eof_trans:
|
|
23911
23911
|
#line 1 "NONE"
|
23912
23912
|
{ switch( act ) {
|
23913
23913
|
case 47:
|
23914
|
-
{{p = ((te))-1;} ADD_BLOCK(); LIST_LAYOUT(); {cs = 2159;
|
23914
|
+
{{p = ((te))-1;} ADD_BLOCK(); LIST_LAYOUT(); {cs = 2159;goto _again;} }
|
23915
23915
|
break;
|
23916
23916
|
case 49:
|
23917
23917
|
{{p = ((te))-1;} CAT(block); }
|
@@ -23925,7 +23925,7 @@ _eof_trans:
|
|
23925
23925
|
break;
|
23926
23926
|
case 160:
|
23927
23927
|
#line 162 "ragel/redcloth_scan.rl"
|
23928
|
-
{te = p+1;{ ADD_BLOCK(); INLINE(html, "dl_close"); {cs = 2250;
|
23928
|
+
{te = p+1;{ ADD_BLOCK(); INLINE(html, "dl_close"); {cs = 2250;goto _again;} }}
|
23929
23929
|
break;
|
23930
23930
|
case 161:
|
23931
23931
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -23941,7 +23941,7 @@ _eof_trans:
|
|
23941
23941
|
break;
|
23942
23942
|
case 164:
|
23943
23943
|
#line 162 "ragel/redcloth_scan.rl"
|
23944
|
-
{te = p;p--;{ ADD_BLOCK(); INLINE(html, "dl_close"); {cs = 2250;
|
23944
|
+
{te = p;p--;{ ADD_BLOCK(); INLINE(html, "dl_close"); {cs = 2250;goto _again;} }}
|
23945
23945
|
break;
|
23946
23946
|
case 165:
|
23947
23947
|
#line 11 "ragel/redcloth_common.rl"
|
@@ -24009,7 +24009,7 @@ _eof_trans:
|
|
24009
24009
|
break;
|
24010
24010
|
case 181:
|
24011
24011
|
#line 171 "ragel/redcloth_scan.rl"
|
24012
|
-
{te = p+1;{ ASET("type", "notextile"); CAT(block); {cs = 2420;
|
24012
|
+
{te = p+1;{ ASET("type", "notextile"); CAT(block); {cs = 2420;goto _again;} }}
|
24013
24013
|
break;
|
24014
24014
|
case 182:
|
24015
24015
|
#line 173 "ragel/redcloth_scan.rl"
|
@@ -24029,7 +24029,7 @@ _eof_trans:
|
|
24029
24029
|
CLEAR_REGS();
|
24030
24030
|
RESET_TYPE();
|
24031
24031
|
CAT(block);
|
24032
|
-
{cs = 2465;
|
24032
|
+
{cs = 2465;goto _again;}
|
24033
24033
|
}}
|
24034
24034
|
break;
|
24035
24035
|
case 186:
|
@@ -24038,7 +24038,7 @@ _eof_trans:
|
|
24038
24038
|
break;
|
24039
24039
|
case 187:
|
24040
24040
|
#line 167 "ragel/redcloth_scan.rl"
|
24041
|
-
{te = p;p--;{ ASET("type", "ignored_line"); {cs = 2434;
|
24041
|
+
{te = p;p--;{ ASET("type", "ignored_line"); {cs = 2434;goto _again;} }}
|
24042
24042
|
break;
|
24043
24043
|
case 188:
|
24044
24044
|
#line 168 "ragel/redcloth_scan.rl"
|
@@ -24046,19 +24046,19 @@ _eof_trans:
|
|
24046
24046
|
break;
|
24047
24047
|
case 189:
|
24048
24048
|
#line 169 "ragel/redcloth_scan.rl"
|
24049
|
-
{te = p;p--;{ ASET("type", "notextile"); {cs = 2435;
|
24049
|
+
{te = p;p--;{ ASET("type", "notextile"); {cs = 2435;goto _again;} }}
|
24050
24050
|
break;
|
24051
24051
|
case 190:
|
24052
24052
|
#line 170 "ragel/redcloth_scan.rl"
|
24053
|
-
{te = p;p--;{ CAT(block); {cs = 2431;
|
24053
|
+
{te = p;p--;{ CAT(block); {cs = 2431;goto _again;} }}
|
24054
24054
|
break;
|
24055
24055
|
case 191:
|
24056
24056
|
#line 171 "ragel/redcloth_scan.rl"
|
24057
|
-
{te = p;p--;{ ASET("type", "notextile"); CAT(block); {cs = 2420;
|
24057
|
+
{te = p;p--;{ ASET("type", "notextile"); CAT(block); {cs = 2420;goto _again;} }}
|
24058
24058
|
break;
|
24059
24059
|
case 192:
|
24060
24060
|
#line 172 "ragel/redcloth_scan.rl"
|
24061
|
-
{te = p;p--;{ {cs = 2423;
|
24061
|
+
{te = p;p--;{ {cs = 2423;goto _again;} }}
|
24062
24062
|
break;
|
24063
24063
|
case 193:
|
24064
24064
|
#line 173 "ragel/redcloth_scan.rl"
|
@@ -24066,23 +24066,23 @@ _eof_trans:
|
|
24066
24066
|
break;
|
24067
24067
|
case 194:
|
24068
24068
|
#line 174 "ragel/redcloth_scan.rl"
|
24069
|
-
{te = p;p--;{ ASET("type", "html_block"); {cs = 2443;
|
24069
|
+
{te = p;p--;{ ASET("type", "html_block"); {cs = 2443;goto _again;} }}
|
24070
24070
|
break;
|
24071
24071
|
case 195:
|
24072
24072
|
#line 175 "ragel/redcloth_scan.rl"
|
24073
|
-
{te = p;p--;{ INLINE(html, "bc_open"); ASET("type", "code"); SET_PLAIN_BLOCK("code"); {cs = 2449;
|
24073
|
+
{te = p;p--;{ INLINE(html, "bc_open"); ASET("type", "code"); SET_PLAIN_BLOCK("code"); {cs = 2449;goto _again;} }}
|
24074
24074
|
break;
|
24075
24075
|
case 196:
|
24076
24076
|
#line 176 "ragel/redcloth_scan.rl"
|
24077
|
-
{te = p;p--;{ INLINE(html, "bq_open"); ASET("type", "p"); {cs = 2457;
|
24077
|
+
{te = p;p--;{ INLINE(html, "bq_open"); ASET("type", "p"); {cs = 2457;goto _again;} }}
|
24078
24078
|
break;
|
24079
24079
|
case 197:
|
24080
24080
|
#line 177 "ragel/redcloth_scan.rl"
|
24081
|
-
{te = p;p--;{ {cs = 2465;
|
24081
|
+
{te = p;p--;{ {cs = 2465;goto _again;} }}
|
24082
24082
|
break;
|
24083
24083
|
case 198:
|
24084
24084
|
#line 178 "ragel/redcloth_scan.rl"
|
24085
|
-
{te = p;p--;{ {cs = 2475;
|
24085
|
+
{te = p;p--;{ {cs = 2475;goto _again;} }}
|
24086
24086
|
break;
|
24087
24087
|
case 199:
|
24088
24088
|
#line 179 "ragel/redcloth_scan.rl"
|
@@ -24090,15 +24090,15 @@ _eof_trans:
|
|
24090
24090
|
break;
|
24091
24091
|
case 200:
|
24092
24092
|
#line 180 "ragel/redcloth_scan.rl"
|
24093
|
-
{te = p;p--;{ CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;
|
24093
|
+
{te = p;p--;{ CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;goto _again;} }}
|
24094
24094
|
break;
|
24095
24095
|
case 201:
|
24096
24096
|
#line 181 "ragel/redcloth_scan.rl"
|
24097
|
-
{te = p;p--;{ {p = (((ts + 1)))-1;} INLINE(html, "dl_open"); ASET("type", "dt"); {cs = 2484;
|
24097
|
+
{te = p;p--;{ {p = (((ts + 1)))-1;} INLINE(html, "dl_open"); ASET("type", "dt"); {cs = 2484;goto _again;} }}
|
24098
24098
|
break;
|
24099
24099
|
case 202:
|
24100
24100
|
#line 182 "ragel/redcloth_scan.rl"
|
24101
|
-
{te = p;p--;{ INLINE(table, "table_close"); DONE(table); {cs = 2465;
|
24101
|
+
{te = p;p--;{ INLINE(table, "table_close"); DONE(table); {cs = 2465;goto _again;} }}
|
24102
24102
|
break;
|
24103
24103
|
case 203:
|
24104
24104
|
#line 183 "ragel/redcloth_scan.rl"
|
@@ -24106,7 +24106,7 @@ _eof_trans:
|
|
24106
24106
|
break;
|
24107
24107
|
case 204:
|
24108
24108
|
#line 184 "ragel/redcloth_scan.rl"
|
24109
|
-
{te = p;p--;{ RESET_TYPE(); {cs = 2465;
|
24109
|
+
{te = p;p--;{ RESET_TYPE(); {cs = 2465;goto _again;} }}
|
24110
24110
|
break;
|
24111
24111
|
case 205:
|
24112
24112
|
#line 185 "ragel/redcloth_scan.rl"
|
@@ -24118,20 +24118,20 @@ _eof_trans:
|
|
24118
24118
|
CLEAR_REGS();
|
24119
24119
|
RESET_TYPE();
|
24120
24120
|
CAT(block);
|
24121
|
-
{cs = 2465;
|
24121
|
+
{cs = 2465;goto _again;}
|
24122
24122
|
}}
|
24123
24123
|
break;
|
24124
24124
|
case 207:
|
24125
24125
|
#line 167 "ragel/redcloth_scan.rl"
|
24126
|
-
{{p = ((te))-1;}{ ASET("type", "ignored_line"); {cs = 2434;
|
24126
|
+
{{p = ((te))-1;}{ ASET("type", "ignored_line"); {cs = 2434;goto _again;} }}
|
24127
24127
|
break;
|
24128
24128
|
case 208:
|
24129
24129
|
#line 171 "ragel/redcloth_scan.rl"
|
24130
|
-
{{p = ((te))-1;}{ ASET("type", "notextile"); CAT(block); {cs = 2420;
|
24130
|
+
{{p = ((te))-1;}{ ASET("type", "notextile"); CAT(block); {cs = 2420;goto _again;} }}
|
24131
24131
|
break;
|
24132
24132
|
case 209:
|
24133
24133
|
#line 182 "ragel/redcloth_scan.rl"
|
24134
|
-
{{p = ((te))-1;}{ INLINE(table, "table_close"); DONE(table); {cs = 2465;
|
24134
|
+
{{p = ((te))-1;}{ INLINE(table, "table_close"); DONE(table); {cs = 2465;goto _again;} }}
|
24135
24135
|
break;
|
24136
24136
|
case 210:
|
24137
24137
|
#line 183 "ragel/redcloth_scan.rl"
|
@@ -24143,51 +24143,51 @@ _eof_trans:
|
|
24143
24143
|
CLEAR_REGS();
|
24144
24144
|
RESET_TYPE();
|
24145
24145
|
CAT(block);
|
24146
|
-
{cs = 2465;
|
24146
|
+
{cs = 2465;goto _again;}
|
24147
24147
|
}}
|
24148
24148
|
break;
|
24149
24149
|
case 212:
|
24150
24150
|
#line 1 "NONE"
|
24151
24151
|
{ switch( act ) {
|
24152
24152
|
case 55:
|
24153
|
-
{{p = ((te))-1;} ASET("type", "ignored_line"); {cs = 2434;
|
24153
|
+
{{p = ((te))-1;} ASET("type", "ignored_line"); {cs = 2434;goto _again;} }
|
24154
24154
|
break;
|
24155
24155
|
case 58:
|
24156
|
-
{{p = ((te))-1;} CAT(block); {cs = 2431;
|
24156
|
+
{{p = ((te))-1;} CAT(block); {cs = 2431;goto _again;} }
|
24157
24157
|
break;
|
24158
24158
|
case 59:
|
24159
|
-
{{p = ((te))-1;} ASET("type", "notextile"); CAT(block); {cs = 2420;
|
24159
|
+
{{p = ((te))-1;} ASET("type", "notextile"); CAT(block); {cs = 2420;goto _again;} }
|
24160
24160
|
break;
|
24161
24161
|
case 61:
|
24162
24162
|
{{p = ((te))-1;} ASET("type", "html"); CAT(block); ADD_BLOCK(); }
|
24163
24163
|
break;
|
24164
24164
|
case 62:
|
24165
|
-
{{p = ((te))-1;} ASET("type", "html_block"); {cs = 2443;
|
24165
|
+
{{p = ((te))-1;} ASET("type", "html_block"); {cs = 2443;goto _again;} }
|
24166
24166
|
break;
|
24167
24167
|
case 67:
|
24168
24168
|
{{p = ((te))-1;} INLINE(html, "hr"); }
|
24169
24169
|
break;
|
24170
24170
|
case 68:
|
24171
|
-
{{p = ((te))-1;} CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;
|
24171
|
+
{{p = ((te))-1;} CLEAR_LIST(); LIST_LAYOUT(); {cs = 2159;goto _again;} }
|
24172
24172
|
break;
|
24173
24173
|
case 69:
|
24174
|
-
{{p = ((te))-1;} {p = (((ts + 1)))-1;} INLINE(html, "dl_open"); ASET("type", "dt"); {cs = 2484;
|
24174
|
+
{{p = ((te))-1;} {p = (((ts + 1)))-1;} INLINE(html, "dl_open"); ASET("type", "dt"); {cs = 2484;goto _again;} }
|
24175
24175
|
break;
|
24176
24176
|
case 70:
|
24177
|
-
{{p = ((te))-1;} INLINE(table, "table_close"); DONE(table); {cs = 2465;
|
24177
|
+
{{p = ((te))-1;} INLINE(table, "table_close"); DONE(table); {cs = 2465;goto _again;} }
|
24178
24178
|
break;
|
24179
24179
|
case 71:
|
24180
24180
|
{{p = ((te))-1;} STORE_LINK_ALIAS(); DONE(block); }
|
24181
24181
|
break;
|
24182
24182
|
case 72:
|
24183
|
-
{{p = ((te))-1;} RESET_TYPE(); {cs = 2465;
|
24183
|
+
{{p = ((te))-1;} RESET_TYPE(); {cs = 2465;goto _again;} }
|
24184
24184
|
break;
|
24185
24185
|
case 75:
|
24186
24186
|
{{p = ((te))-1;}
|
24187
24187
|
CLEAR_REGS();
|
24188
24188
|
RESET_TYPE();
|
24189
24189
|
CAT(block);
|
24190
|
-
{cs = 2465;
|
24190
|
+
{cs = 2465;goto _again;}
|
24191
24191
|
}
|
24192
24192
|
break;
|
24193
24193
|
}
|
@@ -28,7 +28,7 @@ module RedCloth::Formatters
|
|
28
28
|
opts.delete(:class) if filter_classes
|
29
29
|
opts.delete(:id) if filter_ids
|
30
30
|
|
31
|
-
atts = ''
|
31
|
+
atts = ''.dup
|
32
32
|
opts[:"text-align"] = opts.delete(:align)
|
33
33
|
opts[:style] += ';' if opts[:style] && (opts[:style][-1..-1] != ';')
|
34
34
|
[:float, :"text-align", :"vertical-align"].each do |a|
|
@@ -111,15 +111,23 @@ module RedCloth::Formatters::HTML
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def link(opts)
|
114
|
-
|
114
|
+
if (filter_html || sanitize_html) && opts[:href] =~ /^\s*javascript:/i
|
115
|
+
opts[:name]
|
116
|
+
else
|
117
|
+
"<a href=\"#{escape_attribute opts[:href]}\"#{pba(opts)}>#{opts[:name]}</a>"
|
118
|
+
end
|
115
119
|
end
|
116
120
|
|
117
121
|
def image(opts)
|
118
|
-
opts
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
122
|
+
if (filter_html || sanitize_html) && ( opts[:src] =~ /^\s*javascript:/i || opts[:href] =~ /^\s*javascript:/i )
|
123
|
+
opts[:title]
|
124
|
+
else
|
125
|
+
opts.delete(:align)
|
126
|
+
opts[:alt] = opts[:title]
|
127
|
+
img = "<img src=\"#{escape_attribute opts[:src]}\"#{pba(opts)} alt=\"#{escape_attribute opts[:alt].to_s}\" />"
|
128
|
+
img = "<a href=\"#{escape_attribute opts[:href]}\">#{img}</a>" if opts[:href]
|
129
|
+
img
|
130
|
+
end
|
123
131
|
end
|
124
132
|
|
125
133
|
def footno(opts)
|
@@ -316,7 +324,7 @@ private
|
|
316
324
|
# Clean unauthorized tags.
|
317
325
|
def clean_html( text, allowed_tags = BASIC_TAGS )
|
318
326
|
text.gsub!( /<!\[CDATA\[/, '' )
|
319
|
-
text.gsub!( /<(\/*)([A-Za-z]\w
|
327
|
+
text.gsub!( /<(\/*)([A-Za-z]\w*+)([^>]*?)(\s?\/?)>/ ) do |m|
|
320
328
|
raw = $~
|
321
329
|
tag = raw[2].downcase
|
322
330
|
if allowed_tags.has_key? tag
|
@@ -3,7 +3,9 @@ require 'yaml'
|
|
3
3
|
module RedCloth::Formatters::LATEX
|
4
4
|
include RedCloth::Formatters::Base
|
5
5
|
|
6
|
-
|
6
|
+
def self.entities
|
7
|
+
@entities ||= YAML.load(File.read(File.dirname(__FILE__)+'/latex_entities.yml'))
|
8
|
+
end
|
7
9
|
|
8
10
|
module Settings
|
9
11
|
# Maps CSS style names to latex formatting options
|
@@ -163,7 +165,7 @@ module RedCloth::Formatters::LATEX
|
|
163
165
|
|
164
166
|
# FIXME: need caption and label elements similar to image -> figure
|
165
167
|
def table_close(opts)
|
166
|
-
output = "\\begin{table}\n"
|
168
|
+
output = "\\begin{table}\n".dup
|
167
169
|
output << " \\centering\n"
|
168
170
|
output << " \\begin{tabular}{ #{"l " * @table[0].size }}\n"
|
169
171
|
@table.each do |row|
|
@@ -275,8 +277,8 @@ module RedCloth::Formatters::LATEX
|
|
275
277
|
# TODO: what do we do with (unknown) unicode entities ?
|
276
278
|
#
|
277
279
|
def entity(opts)
|
278
|
-
text = opts[:text][0..0] == '#' ? opts[:text][1..-1] : opts[:text]
|
279
|
-
|
280
|
+
text = opts[:text][0..0] == '#' ? opts[:text][1..-1] : opts[:text]
|
281
|
+
RedCloth::Formatters::LATEX.entities[text]
|
280
282
|
end
|
281
283
|
|
282
284
|
def dim(opts)
|
data/lib/redcloth/version.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module RedCloth
|
2
2
|
module VERSION
|
3
3
|
MAJOR = 4
|
4
|
-
MINOR =
|
5
|
-
TINY =
|
6
|
-
RELEASE_CANDIDATE =
|
4
|
+
MINOR = 3
|
5
|
+
TINY = 4
|
6
|
+
# RELEASE_CANDIDATE = 0
|
7
7
|
|
8
|
-
STRING = [MAJOR, MINOR, TINY
|
9
|
-
TAG = "REL_#{[MAJOR, MINOR, TINY
|
10
|
-
FULL_VERSION = "#{[MAJOR, MINOR, TINY
|
8
|
+
STRING = [MAJOR, MINOR, TINY].compact.join('.')
|
9
|
+
TAG = "REL_#{[MAJOR, MINOR, TINY].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
10
|
+
FULL_VERSION = "#{[MAJOR, MINOR, TINY].compact.join('.')}"
|
11
11
|
|
12
12
|
class << self
|
13
13
|
def to_s
|
@@ -22,7 +22,7 @@ module RedCloth
|
|
22
22
|
|
23
23
|
NAME = "RedCloth"
|
24
24
|
GEM_NAME = NAME
|
25
|
-
URL = "
|
25
|
+
URL = "https://github.com/jgarber/redcloth"
|
26
26
|
description = "Textile parser for Ruby."
|
27
27
|
|
28
28
|
if RedCloth.const_defined?(:EXTENSION_LANGUAGE)
|
data/lib/redcloth.rb
CHANGED
@@ -10,6 +10,11 @@ begin
|
|
10
10
|
conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
|
11
11
|
prefix = conf['arch'] =~ /mswin|mingw/ ? "#{conf['MAJOR']}.#{conf['MINOR']}/" : ''
|
12
12
|
lib = "#{prefix}redcloth_scan"
|
13
|
+
begin
|
14
|
+
require lib
|
15
|
+
rescue LoadError => e
|
16
|
+
lib = "redcloth_scan"
|
17
|
+
end
|
13
18
|
require lib
|
14
19
|
rescue LoadError => e
|
15
20
|
e.message << %{\nCouldn't load #{lib}\nThe $LOAD_PATH was:\n#{$LOAD_PATH.join("\n")}}
|