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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3bf6223596d141287ffe67bb0321d0cb329110cf056730a6a88072123e61eb23
4
+ data.tar.gz: 66e55aa28a5fd6d69e9140fc822e9b299bd8fd8b68747cbb61b1322e1686774d
5
+ SHA512:
6
+ metadata.gz: 330980e516cd9966d6860e92ca917d102c9957635bdf76869774a8b8893d372da7aeca4f5d69da3a8db6d98b3c2d8f97f5628f9c96309e34ea424503fbcdb40a
7
+ data.tar.gz: c1614dce1f131bed42fed09cef9e4679ef0d7f49868548d355ce1ee5d2753dd64f9c7e172e70d90a838464f70653c78f9e91e149f22909a6eadd63305969593e
data/CHANGELOG CHANGED
@@ -1,3 +1,40 @@
1
+ == 4.3.4 / Mar 13th, 2024
2
+
3
+ * A round of cleanups [Helio Cola]
4
+ * Stop checking for main function in libc [Jean byroot Boussier]
5
+ * Update maintainer, scrub redcloth.org [Jason Garber]
6
+ * Add GitHub action [Anton Maminov]
7
+
8
+ == 4.3.3 / Nov 2nd, 2023
9
+
10
+ * Add tests for CVE-2023-31606 [Helio Cola]
11
+ * Fix rake compile [Helio Cola and Faria Education Group]
12
+ * Fix CVE-2023-31606 (ReDOS possible in the sanitize_html function) [Kornelius Kalnbach and Merbin Russel]
13
+ * Immutable strings [Matijs van Zuijlen]
14
+
15
+ == 4.3.2 / May 23rd, 2016
16
+
17
+ * Fix additional case for CVE-2012-6684 [Joshua Siler]
18
+
19
+ == 4.3.1 / May 17th, 2016
20
+
21
+ * Fix additional case for CVE-2012-6684 [Joshua Siler]
22
+
23
+ == 4.3.0 / April 29th, 2016
24
+
25
+ * Remove JRuby and Windows cross compilation and support
26
+ * Add Ruby 2.2.3 testing and support
27
+
28
+ * include CVE-2012-6684 fix [Tomas Pospisek]
29
+ * fix by [Antonio Terceiro]
30
+ * see http://sources.debian.net/src/ruby-redcloth/4.2.9-4/debian/patches/0001-Filter-out-javascript-links-when-using-filter_html-o.patch/
31
+ * vulnerability reported by [Kousuke Ebihara]
32
+ * see http://co3k.org/blog/redcloth-unfixed-xss-en
33
+
34
+ == 4.2.9.1 / February 24, 2015
35
+
36
+ * Lazy-load latex_entities.yml [Charlie Somerville]
37
+
1
38
  == 4.2.9 / November 25, 2011
2
39
 
3
40
  * Fix RbConfig / Config warning in Ruby 1.9.3. [Steve Purcell, Robert Gleeson, and unclaimedbaggage]
@@ -82,7 +119,7 @@
82
119
  * Accept multiline content in table cells. [Jason Garber]
83
120
 
84
121
  * Change to list attributes so you can give style/class to list items (taken from PyTextile). Breaks backwards compatibility.
85
-
122
+
86
123
  Before, the style applied to the first list item applied to the entire list. Now, class/id/style placed
87
124
  before the list applies to the list element and after the hash or asterisk applies to the list item. For
88
125
  example:
@@ -163,7 +200,7 @@
163
200
  To compile the jruby version of the gem: jruby -S rake compile
164
201
 
165
202
  * Added textilize ERB utility method. [edraut]
166
- Use it in an ERB template like this: <%=t my_textile_string %> or
203
+ Use it in an ERB template like this: <%=t my_textile_string %> or
167
204
  <%=r %{Some *textile* if you please!} %>
168
205
 
169
206
  * Fix extended blockcode stripping whitespace following blank line. #78
@@ -258,4 +295,4 @@
258
295
 
259
296
  * Over 500 tests prevent regression
260
297
 
261
- * It's 40 times faster than the previous version.
298
+ * It's 40 times faster than the previous version.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :compilation do
5
- gem 'rvm', '~> 1.2.6'
5
+ gem 'rvm', '~> 1.11.3.9'
6
6
  gem 'rake-compiler', '~> 0.7.1'
7
- end
7
+ end
data/README.rdoc CHANGED
@@ -1,59 +1,47 @@
1
1
  = RedCloth - Textile parser for Ruby
2
2
 
3
- Homepage:: http://redcloth.org
3
+ Homepage:: https://github.com/jgarber/redcloth
4
+ Maintainer:: Helio Cola https://github.com/heliocola
4
5
  Author:: Jason Garber
5
6
  Copyright:: (c) 2011 Jason Garber
6
7
  License:: MIT
7
8
 
8
- (See http://redcloth.org/textile/ for a Textile reference.)
9
+ {rdoc-image:https://codeclimate.com/github/jgarber/redcloth/badges/gpa.svg}[https://codeclimate.com/github/jgarber/redcloth]
9
10
 
10
11
  = RedCloth
11
12
 
12
13
  RedCloth is a Ruby library for converting Textile into HTML.
13
14
 
15
+ == Attention - Deprecating JRuby and Windows support in version 4.3
16
+
17
+ In order to prioritize merging a fix for the long standing vulnerability *CVE-2012-6684*, our {new maintainer}[https://github.com/joshuasiler] has elected to stop maintaining the precompiled versions for Windows and JRuby.
18
+
14
19
  == Installing
15
20
 
16
21
  RedCloth can be installed via RubyGems:
17
22
 
18
23
  gem install RedCloth
19
24
 
20
- It will install the appropriate Ruby, JRuby, or Win32 gem. If using JRuby,
21
- version 1.1.5 or greater is required.
22
-
23
25
  == Compiling
24
26
 
25
27
  If you just want to use RedCloth, you do NOT need to build/compile it. It is
26
28
  compiled from C sources automatically when you install the gem on the ruby
27
- platform. Precompiled binary gems are provided for JRuby and Win32 platforms.
29
+ platform. Precompiled binary gems are provided for JRuby and Win32 platforms prior to version 4.3.
28
30
 
29
31
  RedCloth can be compiled with <tt>rake compile</tt>. Ragel 6.3 or greater is
30
32
  required. Again, Ragel is NOT needed to simply use RedCloth.
31
33
 
32
34
  === Supported platforms
33
35
 
34
- By default, the rake compile task builds a native C extension (MRI 1.8 or 1.9)
35
- or Java extension (JRuby 1.3). A pure Ruby version can also be generated, but
36
- it's super slow and Ruby 1.8-only. The JRuby and pure-Ruby extensions don't
37
- support multi-byte characters. Cross-compiling for win32 uses rake-compiler.
36
+ By default, the rake compile task builds a native C extension (MRI 1.8 or 1.9). A pure Ruby version can also be generated, but it's super slow and Ruby 1.8-only, and doesn't
37
+ support multi-byte characters.
38
38
 
39
39
  The RedCloth::EXTENSION_LANGUAGE constant indicates in which language your
40
40
  copy of RedCloth is compiled.
41
41
 
42
- === Compiling gems
43
-
44
- To compile MRI, JRuby, and win32 gems, you need rvm and rake-compiler. These
45
- and other dependencies can be installed with bundler. Then rake build:all
46
- takes care of compiling and packaging all gems.
47
-
48
- 1. gem install bundler
49
- 2. bundle install
50
- 3. rake-compiler cross-ruby VERSION=1.8.6-p398
51
- 4. rake-compiler cross-ruby VERSION=1.9.1-p243
52
- 5. rake build:all
53
-
54
42
  == Bugs
55
43
 
56
- Please submit bugs to http://jgarber.lighthouseapp.com/projects/13054-redcloth/overview
44
+ Please submit bugs as issues to this repo.
57
45
 
58
46
  == Using RedCloth
59
47
 
@@ -69,7 +57,7 @@ Multi-line example:
69
57
 
70
58
  doc = RedCloth.new <<EOD
71
59
  h2. Test document
72
-
60
+
73
61
  Just a simple test.
74
62
  EOD
75
63
  puts doc.to_html
@@ -122,11 +110,11 @@ of small portions of text within a paragraph.
122
110
 
123
111
  == Links
124
112
 
125
- To make a hypertext link, put the link text in "quotation
113
+ To make a hypertext link, put the link text in "quotation
126
114
  marks" followed immediately by a colon and the URL of the link.
127
115
 
128
- Optional: text in (parentheses) following the link text,
129
- but before the closing quotation mark, will become a title
116
+ Optional: text in (parentheses) following the link text,
117
+ but before the closing quotation mark, will become a title
130
118
  attribute for the link, visible as a tool tip when a cursor is above it.
131
119
 
132
120
  Example:
@@ -141,12 +129,12 @@ Will become:
141
129
 
142
130
  To insert an image, put the URL for the image inside exclamation marks.
143
131
 
144
- Optional: text that immediately follows the URL in (parentheses) will
145
- be used as the Alt text for the image. Images on the web should always
146
- have descriptive Alt text for the benefit of readers using non-graphical
132
+ Optional: text that immediately follows the URL in (parentheses) will
133
+ be used as the Alt text for the image. Images on the web should always
134
+ have descriptive Alt text for the benefit of readers using non-graphical
147
135
  browsers.
148
136
 
149
- Optional: place a colon followed by a URL immediately after the
137
+ Optional: place a colon followed by a URL immediately after the
150
138
  closing ! to make the image into a link.
151
139
 
152
140
  Example:
@@ -167,11 +155,11 @@ Will become:
167
155
 
168
156
  == Defining Acronyms
169
157
 
170
- HTML allows authors to define acronyms via the tag. The definition appears as a
171
- tool tip when a cursor hovers over the acronym. A crucial aid to clear writing,
158
+ HTML allows authors to define acronyms via the tag. The definition appears as a
159
+ tool tip when a cursor hovers over the acronym. A crucial aid to clear writing,
172
160
  this should be used at least once for each acronym in documents where they appear.
173
161
 
174
- To quickly define an acronym in Textile, place the full text in (parentheses)
162
+ To quickly define an acronym in Textile, place the full text in (parentheses)
175
163
  immediately following the acronym.
176
164
 
177
165
  Example:
@@ -181,6 +169,13 @@ Example:
181
169
  Will become:
182
170
 
183
171
  <acronym title="American Civil Liberties Union">ACLU</acronym>
172
+
173
+ == Filtering HTML
174
+
175
+ RedCloth doesn't filter unsafe html tags by default, do to this use the following syntax:
176
+ RedCloth.new("<script>alert(1)</script>", [:filter_html]).to_html
177
+ which will filter the script tags from the HTML resulting in:
178
+ "&lt;script&gt;alert(1)&lt;/script&gt;"
184
179
 
185
180
  == Adding Tables
186
181
 
@@ -194,5 +189,3 @@ Styles are applied with curly braces.
194
189
 
195
190
  table{border:1px solid black}.
196
191
  {background:#ddd;color:red}. |a|red|row|
197
-
198
-
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'rubygems'
3
3
  require 'bundler'
4
- ENV['RUBYOPT'] = nil # Necessary to prevent Bundler from *&^%$#ing up rake-compiler.
5
4
 
6
5
  require 'rake/clean'
7
6
 
@@ -15,4 +14,4 @@ else
15
14
  Bundler.settings.without = [:compilation]
16
15
  Bundler.setup(:default, :development)
17
16
  load 'tasks/rspec.rake'
18
- end
17
+ end
@@ -2,5 +2,4 @@ require 'mkmf'
2
2
  CONFIG['warnflags'].gsub!(/-Wshorten-64-to-32/, '') if CONFIG['warnflags']
3
3
  $CFLAGS << ' -O0 -Wall ' if CONFIG['CC'] =~ /gcc/
4
4
  dir_config("redcloth_scan")
5
- have_library("c", "main")
6
5
  create_makefile("redcloth_scan")
@@ -7491,7 +7491,7 @@ _eof_trans:
7491
7491
  break;
7492
7492
  case 24:
7493
7493
  #line 103 "ragel/redcloth_inline.rl"
7494
- {te = p+1;{ CAT(block); {cs = 1270; goto _again;} }}
7494
+ {te = p+1;{ CAT(block); {cs = 1270;goto _again;} }}
7495
7495
  break;
7496
7496
  case 25:
7497
7497
  #line 6 "ragel/redcloth_common.c.rl"
@@ -7591,7 +7591,7 @@ _eof_trans:
7591
7591
  break;
7592
7592
  case 49:
7593
7593
  #line 116 "ragel/redcloth_inline.rl"
7594
- {te = p+1;{ CAT(block); {cs = 1516; goto _again;} }}
7594
+ {te = p+1;{ CAT(block); {cs = 1516;goto _again;} }}
7595
7595
  break;
7596
7596
  case 50:
7597
7597
  #line 117 "ragel/redcloth_inline.rl"
@@ -7735,7 +7735,7 @@ _eof_trans:
7735
7735
  break;
7736
7736
  case 85:
7737
7737
  #line 116 "ragel/redcloth_inline.rl"
7738
- {te = p;p--;{ CAT(block); {cs = 1516; goto _again;} }}
7738
+ {te = p;p--;{ CAT(block); {cs = 1516;goto _again;} }}
7739
7739
  break;
7740
7740
  case 86:
7741
7741
  #line 118 "ragel/redcloth_inline.rl"
@@ -7866,7 +7866,7 @@ _eof_trans:
7866
7866
  {{p = ((te))-1;} PASS_CODE(block, "text", "code"); }
7867
7867
  break;
7868
7868
  case 8:
7869
- {{p = ((te))-1;} CAT(block); {cs = 1516; goto _again;} }
7869
+ {{p = ((te))-1;} CAT(block); {cs = 1516;goto _again;} }
7870
7870
  break;
7871
7871
  case 10:
7872
7872
  {{p = ((te))-1;} PARSE_ATTR("text"); PASS(block, "text", "strong"); }