RedCloth 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of RedCloth might be problematic. Click here for more details.
- data/CHANGELOG +37 -4
- data/bin/redcloth +1 -1
- data/ext/redcloth_scan/redcloth.h +1 -1
- data/ext/redcloth_scan/redcloth_inline.c +4747 -4334
- data/ext/redcloth_scan/redcloth_inline.rl +14 -6
- data/ext/redcloth_scan/redcloth_scan.c +5454 -3529
- data/ext/redcloth_scan/redcloth_scan.rl +9 -6
- data/lib/redcloth.rb +2 -0
- data/lib/redcloth/formatters/base.rb +9 -2
- data/lib/redcloth/formatters/html.rb +17 -14
- data/lib/redcloth/formatters/latex.rb +0 -4
- data/lib/redcloth/version.rb +11 -1
- data/lib/redcloth_scan.bundle +0 -0
- data/test/basic.yml +9 -4
- data/test/code.yml +8 -0
- data/test/filter_pba.yml +9 -1
- data/test/html.yml +29 -1
- data/test/images.yml +12 -0
- data/test/links.yml +16 -8
- data/test/test_parser.rb +8 -3
- metadata +4 -4
@@ -9,7 +9,7 @@
|
|
9
9
|
#include "redcloth.h"
|
10
10
|
|
11
11
|
VALUE mRedCloth, super_ParseError, super_RedCloth, super_HTML, super_LATEX;
|
12
|
-
int SYM_escape_preformatted;
|
12
|
+
int SYM_escape_preformatted, SYM_escape_attributes;
|
13
13
|
|
14
14
|
%%{
|
15
15
|
|
@@ -45,7 +45,7 @@ int SYM_escape_preformatted;
|
|
45
45
|
long_dd = dd_start " "* LF %{ ADD_BLOCK(); ASET(type, dd); } any+ >A %{ TRANSFORM(text) } :>> "=:" ;
|
46
46
|
dl_start = (dt_start mtext (LF dt_start mtext)* " "* dd_start) ;
|
47
47
|
blank_line = LF;
|
48
|
-
link_alias = ( "[" >{ ASET(type, ignore) } %A
|
48
|
+
link_alias = ( "[" >{ ASET(type, ignore) } %A chars %T "]" %A uri %{ STORE_URL(href); } ) ;
|
49
49
|
|
50
50
|
# image lookahead
|
51
51
|
IMG_A_LEFT = "<" %{ ASET(float, left) } ;
|
@@ -60,7 +60,7 @@ int SYM_escape_preformatted;
|
|
60
60
|
html_start = indent >B %{STORE_B(indent_before_start)} block_start_tag >B %{STORE_B(start_tag)} indent >B %{STORE_B(indent_after_start)} ;
|
61
61
|
html_end = indent >B %{STORE_B(indent_before_end)} block_end_tag >B %{STORE_B(end_tag)} (indent LF?) >B %{STORE_B(indent_after_end)} ;
|
62
62
|
standalone_html = indent (block_start_tag | block_empty_tag | block_end_tag) indent LF+;
|
63
|
-
html_end_terminating_block = ( indent block_end_tag ) >A @{ p = reg - 1; } ;
|
63
|
+
html_end_terminating_block = ( LF indent block_end_tag ) >A @{ p = reg - 1; } ;
|
64
64
|
|
65
65
|
# tables
|
66
66
|
para = ( default+ ) -- LF ;
|
@@ -71,7 +71,7 @@ int SYM_escape_preformatted;
|
|
71
71
|
tr = ( trdef? "|" %{INLINE(table, tr_open);} td+ ) >X %{INLINE(table, tr_close);} ;
|
72
72
|
trows = ( tr (LF >X tr)* ) ;
|
73
73
|
tdef = ( "table" >X A C :> dotspace LF ) ;
|
74
|
-
table = ( tdef? trows >{INLINE(table, table_open);} ) >{ reg = NULL; } ;
|
74
|
+
table = ( tdef? trows >{table = rb_str_new2(""); INLINE(table, table_open);} ) >{ reg = NULL; } ;
|
75
75
|
|
76
76
|
# info
|
77
77
|
redcloth_version = ("RedCloth" >A ("::" | " " ) "VERSION"i ":"? " ")? %{STORE(prefix)} "RedCloth::VERSION" (LF* EOF | double_return) ;
|
@@ -419,9 +419,11 @@ redcloth_html_esc(int argc, VALUE* argv, VALUE self) //(self, str, level)
|
|
419
419
|
if (level != SYM_escape_preformatted) {
|
420
420
|
switch (*t2)
|
421
421
|
{
|
422
|
-
case '"': ch = "quot"; break;
|
423
|
-
case '\'': ch = "squot"; break;
|
424
422
|
case '\n': ch = "br"; break;
|
423
|
+
case '"' : ch = "quot"; break;
|
424
|
+
case '\'':
|
425
|
+
ch = (level == SYM_escape_attributes) ? "apos" : "squot";
|
426
|
+
break;
|
425
427
|
}
|
426
428
|
}
|
427
429
|
|
@@ -521,4 +523,5 @@ void Init_redcloth_scan()
|
|
521
523
|
rb_define_method(super_RedCloth, "html_esc", redcloth_html_esc, -1);
|
522
524
|
rb_define_method(super_RedCloth, "latex_esc", redcloth_latex_esc, 1);
|
523
525
|
SYM_escape_preformatted = ID2SYM(rb_intern("html_escape_preformatted"));
|
526
|
+
SYM_escape_attributes = ID2SYM(rb_intern("html_escape_attributes"));
|
524
527
|
}
|
data/lib/redcloth.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__))
|
2
2
|
|
3
|
+
Object.send(:remove_const, :RedCloth) if Object.const_defined?(:RedCloth) # in case this is a frozen gem in Rails 2.1 and RedCloth 3.0.4 was already loaded by Rails' ActionView::Helpers::TextHelper. This appears to be fixed in Edge Rails [51e4106].
|
4
|
+
|
3
5
|
require 'redcloth_scan'
|
4
6
|
require 'redcloth/version'
|
5
7
|
require 'redcloth/textile_doc'
|
@@ -16,7 +16,7 @@ module RedCloth::Formatters
|
|
16
16
|
opts[:style] = "#{a}:#{opts[a]}em;#{opts[:style]}" if opts[a]
|
17
17
|
end
|
18
18
|
[:style, :class, :lang, :id, :colspan, :rowspan, :title, :start, :align].each do |a|
|
19
|
-
atts << " #{a}=\"#{ opts[a] }\"" if opts[a]
|
19
|
+
atts << " #{a}=\"#{ html_esc(opts[a].to_s, :html_escape_attributes) }\"" if opts[a]
|
20
20
|
end
|
21
21
|
atts
|
22
22
|
end
|
@@ -27,13 +27,20 @@ module RedCloth::Formatters
|
|
27
27
|
alias_method :notextile, :ignore
|
28
28
|
|
29
29
|
def redcloth_version(opts)
|
30
|
-
p(:text => "#{opts[:prefix]}#{RedCloth::VERSION
|
30
|
+
p(:text => "#{opts[:prefix]}#{RedCloth::VERSION}")
|
31
31
|
end
|
32
32
|
|
33
33
|
def inline_redcloth_version(opts)
|
34
34
|
RedCloth::VERSION::STRING
|
35
35
|
end
|
36
36
|
|
37
|
+
[:del_phrase, :sup_phrase, :sub_phrase].each do |phrase_method|
|
38
|
+
method = phrase_method.to_s[0..2]
|
39
|
+
define_method(phrase_method) do |opts|
|
40
|
+
"#{opts[:beginning_space]}#{self.send(method, opts)}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
37
44
|
def method_missing(method, opts)
|
38
45
|
opts[:text] || ""
|
39
46
|
end
|
@@ -11,6 +11,11 @@ module RedCloth::Formatters::HTML
|
|
11
11
|
html_esc(text, :html_escape_preformatted)
|
12
12
|
end
|
13
13
|
|
14
|
+
# escaping for HTML attributes
|
15
|
+
def escape_attribute(text)
|
16
|
+
html_esc(text, :html_escape_attributes)
|
17
|
+
end
|
18
|
+
|
14
19
|
def after_transform(text)
|
15
20
|
text.chomp!
|
16
21
|
end
|
@@ -47,10 +52,6 @@ module RedCloth::Formatters::HTML
|
|
47
52
|
"<del#{pba(opts)}>#{opts[:text]}</del>"
|
48
53
|
end
|
49
54
|
|
50
|
-
def del_phrase(opts)
|
51
|
-
" #{del(opts)}"
|
52
|
-
end
|
53
|
-
|
54
55
|
[:ol, :ul].each do |m|
|
55
56
|
define_method("#{m}_open") do |opts|
|
56
57
|
opts[:block] = true
|
@@ -116,7 +117,7 @@ module RedCloth::Formatters::HTML
|
|
116
117
|
|
117
118
|
def bq_open(opts)
|
118
119
|
opts[:block] = true
|
119
|
-
cite = opts[:cite] ? " cite=\"#{ opts[:cite] }\"" : ''
|
120
|
+
cite = opts[:cite] ? " cite=\"#{ escape_attribute opts[:cite] }\"" : ''
|
120
121
|
"<blockquote#{cite}#{pba(opts)}>\n"
|
121
122
|
end
|
122
123
|
|
@@ -136,14 +137,14 @@ module RedCloth::Formatters::HTML
|
|
136
137
|
opts[:name] = md[1]
|
137
138
|
opts[:title] = md[2]
|
138
139
|
end
|
139
|
-
"<a href=\"#{opts[:href]
|
140
|
+
"<a href=\"#{escape_attribute opts[:href]}\"#{pba(opts)}>#{opts[:name]}</a>"
|
140
141
|
end
|
141
142
|
|
142
143
|
def image(opts)
|
143
144
|
opts.delete(:align)
|
144
145
|
opts[:alt] = opts[:title]
|
145
|
-
img = "<img src=\"#{
|
146
|
-
img = "<a href=\"#{
|
146
|
+
img = "<img src=\"#{escape_attribute opts[:src]}\"#{pba(opts)} alt=\"#{escape_attribute opts[:alt].to_s}\" />"
|
147
|
+
img = "<a href=\"#{escape_attribute opts[:href]}\">#{img}</a>" if opts[:href]
|
147
148
|
img
|
148
149
|
end
|
149
150
|
|
@@ -188,8 +189,10 @@ module RedCloth::Formatters::HTML
|
|
188
189
|
end
|
189
190
|
|
190
191
|
def dim(opts)
|
191
|
-
|
192
|
-
|
192
|
+
opts[:text].gsub!('x', '×')
|
193
|
+
opts[:text].gsub!("'", '′')
|
194
|
+
opts[:text].gsub!('"', '″')
|
195
|
+
opts[:text]
|
193
196
|
end
|
194
197
|
|
195
198
|
def trademark(opts)
|
@@ -208,10 +211,6 @@ module RedCloth::Formatters::HTML
|
|
208
211
|
"&#{opts[:text]};"
|
209
212
|
end
|
210
213
|
|
211
|
-
def urlesc(txt)
|
212
|
-
txt.gsub(/&/, '&')
|
213
|
-
end
|
214
|
-
|
215
214
|
def amp(opts)
|
216
215
|
"&"
|
217
216
|
end
|
@@ -240,6 +239,10 @@ module RedCloth::Formatters::HTML
|
|
240
239
|
"’"
|
241
240
|
end
|
242
241
|
|
242
|
+
def apos(opts)
|
243
|
+
"'"
|
244
|
+
end
|
245
|
+
|
243
246
|
def html(opts)
|
244
247
|
"#{opts[:text]}\n"
|
245
248
|
end
|
data/lib/redcloth/version.rb
CHANGED
@@ -2,12 +2,22 @@ module RedCloth
|
|
2
2
|
module VERSION
|
3
3
|
MAJOR = 4
|
4
4
|
MINOR = 0
|
5
|
-
TINY =
|
5
|
+
TINY = 2
|
6
6
|
RELEASE_CANDIDATE = nil
|
7
7
|
|
8
8
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
9
9
|
TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
10
10
|
FULL_VERSION = "#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('.')}"
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def to_s
|
14
|
+
STRING
|
15
|
+
end
|
16
|
+
|
17
|
+
def ==(arg)
|
18
|
+
STRING == arg
|
19
|
+
end
|
20
|
+
end
|
11
21
|
end
|
12
22
|
|
13
23
|
NAME = "RedCloth"
|
data/lib/redcloth_scan.bundle
CHANGED
Binary file
|
data/test/basic.yml
CHANGED
@@ -166,13 +166,13 @@ in: "Observe: 2x3x4."
|
|
166
166
|
html: "<p>Observe: 2×3×4.</p>"
|
167
167
|
lite_mode_html: "Observe: 2×3×4."
|
168
168
|
---
|
169
|
-
name: dimension
|
169
|
+
name: dimension signs with double primes
|
170
170
|
in: 'My mouse: 2.5" x 4".'
|
171
|
-
html: '<p>My mouse: 2.5
|
171
|
+
html: '<p>My mouse: 2.5″ × 4″.</p>'
|
172
172
|
---
|
173
|
-
name: dimension
|
173
|
+
name: dimension signs with single primes
|
174
174
|
in: "My office: 5' x 4.5'."
|
175
|
-
html: "<p>My office: 5&#
|
175
|
+
html: "<p>My office: 5′ × 4.5′.</p>"
|
176
176
|
---
|
177
177
|
name: trademark and copyright
|
178
178
|
desc: Conversion of trademark and copyright symbols.
|
@@ -265,6 +265,11 @@ name: subscript
|
|
265
265
|
desc: To subscript, surround with tildes.
|
266
266
|
in: log ~2~ x
|
267
267
|
html: <p>log <sub>2</sub> x</p>
|
268
|
+
---
|
269
|
+
name: tight superscript and subscript
|
270
|
+
desc: if you want your superscript or subscript to not be surrounded by spaces, you must use square brackets
|
271
|
+
in: f(x, n) = log[~4~]x[^n^]
|
272
|
+
html: '<p>f(x, n) = log<sub>4</sub>x<sup>n</sup></p>'
|
268
273
|
---
|
269
274
|
name: span
|
270
275
|
desc: Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span.
|
data/test/code.yml
CHANGED
@@ -17,6 +17,10 @@ name: inlne code escapement describing textile paragraph styling
|
|
17
17
|
in: 'This paragraph is aligned left but if you add this: @p>.@ to the beginning it will be aligned right.'
|
18
18
|
html: '<p>This paragraph is aligned left but if you add this: <code>p>.</code> to the beginning it will be aligned right.</p>'
|
19
19
|
---
|
20
|
+
name: escapes code snippet containing html tag
|
21
|
+
in: 'At the top of each page, please put @<h2>Title</h2>@ in the HTML.'
|
22
|
+
html: '<p>At the top of each page, please put <code><h2>Title</h2></code> in the <span class="caps">HTML</span>.</p>'
|
23
|
+
---
|
20
24
|
name: escaping in blockcode
|
21
25
|
in: 'bc. This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.'
|
22
26
|
html: '<pre><code>This is within a block of code, so < and > should be entities. You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.</code></pre>'
|
@@ -164,6 +168,10 @@ html: |-
|
|
164
168
|
|
165
169
|
<code>I saw a ship. It ate my elephant.</code></pre>
|
166
170
|
---
|
171
|
+
name: block containing html tags
|
172
|
+
in: bc. Can I talk about <h2>Headings</h2> here?
|
173
|
+
html: '<pre><code>Can I talk about <h2>Headings</h2> here?</code></pre>'
|
174
|
+
---
|
167
175
|
name: escape latex standard symbols
|
168
176
|
in: "standard symbols # $ % & _ { }"
|
169
177
|
latex: "standard symbols \\# \\$ \\% \\& \\_ \\{ \\}\n\n"
|
data/test/filter_pba.yml
CHANGED
@@ -9,4 +9,12 @@ class_filtered_html: "<p>Test</p>"
|
|
9
9
|
---
|
10
10
|
name: filter ids
|
11
11
|
in: "p(#myid). Test"
|
12
|
-
id_filtered_html: "<p>Test</p>"
|
12
|
+
id_filtered_html: "<p>Test</p>"
|
13
|
+
---
|
14
|
+
name: correct application of double quote entity when using styles
|
15
|
+
in: 'p{background: #white url("../chunky_bacon.jpg")}. The quick brown "cartoon" fox jumps over the lazy dog'
|
16
|
+
html: '<p style="background: #white url("../chunky_bacon.jpg");">The quick brown “cartoon” fox jumps over the lazy dog</p>'
|
17
|
+
---
|
18
|
+
name: correct application of single quote entity when using styles
|
19
|
+
in: "p{background: #white url('../chunky_bacon.jpg')}. The quick brown 'cartoon' fox jumps over the lazy dog"
|
20
|
+
html: '<p style="background: #white url('../chunky_bacon.jpg');">The quick brown ‘cartoon’ fox jumps over the lazy dog</p>'
|
data/test/html.yml
CHANGED
@@ -268,4 +268,32 @@ html: |-
|
|
268
268
|
<blockquote>
|
269
269
|
<p>This is a blockquote.</p>
|
270
270
|
</blockquote>
|
271
|
-
</div>
|
271
|
+
</div>
|
272
|
+
---
|
273
|
+
name: before table does not affect table
|
274
|
+
in: |-
|
275
|
+
<div>
|
276
|
+
|
277
|
+
h2. heading
|
278
|
+
|
279
|
+
|a|b|c|
|
280
|
+
|d|e|f|
|
281
|
+
html: |-
|
282
|
+
<div>
|
283
|
+
<h2>heading</h2>
|
284
|
+
<table>
|
285
|
+
<tr>
|
286
|
+
<td>a</td>
|
287
|
+
<td>b</td>
|
288
|
+
<td>c</td>
|
289
|
+
</tr>
|
290
|
+
<tr>
|
291
|
+
<td>d</td>
|
292
|
+
<td>e</td>
|
293
|
+
<td>f</td>
|
294
|
+
</tr>
|
295
|
+
</table>
|
296
|
+
---
|
297
|
+
name: tilde in innerHTML is not altered
|
298
|
+
in: '<a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a>'
|
299
|
+
html: '<p><a href="http://foo.com/bar?something=1~2~3">http://foo.com/bar?something=1~2~3</a></p>'
|
data/test/images.yml
CHANGED
@@ -200,3 +200,15 @@ html: <p><img src="image.jpg" style="color:red;" alt="" /></p>
|
|
200
200
|
name: image with style and dotspace
|
201
201
|
in: "!{color:red}. image.jpg!"
|
202
202
|
html: <p><img src="image.jpg" style="color:red;" alt="" /></p>
|
203
|
+
---
|
204
|
+
name: image attributes has ampersand html entity in alt and title
|
205
|
+
in: "!/pictures/cat_and_fox.jpg(Trady Blix & The cartoon fox)!"
|
206
|
+
html: '<p><img src="/pictures/cat_and_fox.jpg" title="Trady Blix & The cartoon fox" alt="Trady Blix & The cartoon fox" /></p>'
|
207
|
+
---
|
208
|
+
name: image attributes has double quote html entity in alt and title
|
209
|
+
in: '!/pictures/bacon.jpg(The fox said: "Have some chunky bacon")!'
|
210
|
+
html: '<p><img src="/pictures/bacon.jpg" title="The fox said: "Have some chunky bacon"" alt="The fox said: "Have some chunky bacon"" /></p>'
|
211
|
+
---
|
212
|
+
name: image attributes has single quote html entity in alt and title
|
213
|
+
in: "!/pictures/bacon.jpg(The fox said: 'Have some chunky bacon')!"
|
214
|
+
html: '<p><img src="/pictures/bacon.jpg" title="The fox said: 'Have some chunky bacon'" alt="The fox said: 'Have some chunky bacon'" /></p>'
|
data/test/links.yml
CHANGED
@@ -75,19 +75,19 @@ in: '"link text":http://example.com/?foo=bar#a10'
|
|
75
75
|
html: <p><a href="http://example.com/?foo=bar#a10">link text</a></p>
|
76
76
|
---
|
77
77
|
in: '"link text":http://example.com/?foo=bar&a=b'
|
78
|
-
html: <p><a href="http://example.com/?foo=bar
|
78
|
+
html: <p><a href="http://example.com/?foo=bar&a=b">link text</a></p>
|
79
79
|
---
|
80
80
|
in: '"link text":http://example.com/?foo=bar&a=b#1'
|
81
|
-
html: <p><a href="http://example.com/?foo=bar
|
81
|
+
html: <p><a href="http://example.com/?foo=bar&a=b#1">link text</a></p>
|
82
82
|
---
|
83
83
|
in: '"link text":http://example.com/?foo=bar&a=b#a'
|
84
|
-
html: <p><a href="http://example.com/?foo=bar
|
84
|
+
html: <p><a href="http://example.com/?foo=bar&a=b#a">link text</a></p>
|
85
85
|
---
|
86
86
|
in: '"link text":http://example.com/?foo=bar&a=b#a1'
|
87
|
-
html: <p><a href="http://example.com/?foo=bar
|
87
|
+
html: <p><a href="http://example.com/?foo=bar&a=b#a1">link text</a></p>
|
88
88
|
---
|
89
89
|
in: '"link text":http://example.com/?foo=bar&a=b#a10'
|
90
|
-
html: <p><a href="http://example.com/?foo=bar
|
90
|
+
html: <p><a href="http://example.com/?foo=bar&a=b#a10">link text</a></p>
|
91
91
|
---
|
92
92
|
in: 'This is a "link":http://example.com/'
|
93
93
|
html: <p>This is a <a href="http://example.com/">link</a></p>
|
@@ -154,13 +154,13 @@ in: '"Lab Exercises":../lab/exercises/exercises.html.'
|
|
154
154
|
html: <p><a href="../lab/exercises/exercises.html">Lab Exercises</a>.</p>
|
155
155
|
---
|
156
156
|
in: 'Go to "discuss":http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&thread=26627 to discuss.'
|
157
|
-
html: <p>Go to <a href="http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1
|
157
|
+
html: <p>Go to <a href="http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&thread=26627">discuss</a> to discuss.</p>
|
158
158
|
---
|
159
159
|
in: '* "rubylang":http://www.ruby-lang.org/en/'
|
160
160
|
html: "<ul>\n\t<li><a href=\"http://www.ruby-lang.org/en/\">rubylang</a></li>\n</ul>"
|
161
161
|
---
|
162
162
|
in: 'The ION coding style document found at "IONCodingStyleGuide.doc":http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22 codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text'
|
163
|
-
html: <p>The <span class="caps">ION</span> coding style document found at <a href="http://perforce:8081/@md=d
|
163
|
+
html: <p>The <span class="caps">ION</span> coding style document found at <a href="http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22">IONCodingStyleGuide.doc</a> codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in <span class="caps">ION</span>. Test text</p>
|
164
164
|
---
|
165
165
|
in: '"testing":'
|
166
166
|
html: "<p>“testing”:</p>"
|
@@ -220,4 +220,12 @@ html: '<p>This is a regular link (but in parentheses: <a href="http://www.google
|
|
220
220
|
name: quotes and follow link
|
221
221
|
in: 'Some "text" followed by a "link":http://redcloth.org.'
|
222
222
|
html: '<p>Some “text” followed by a <a href="http://redcloth.org">link</a>.</p>'
|
223
|
-
lite_mode_html: 'Some “text” followed by a <a href="http://redcloth.org">link</a>.'
|
223
|
+
lite_mode_html: 'Some “text” followed by a <a href="http://redcloth.org">link</a>.'
|
224
|
+
---
|
225
|
+
name: link alias containing dashes
|
226
|
+
in: |-
|
227
|
+
"link":google-rocks
|
228
|
+
|
229
|
+
[google-rocks]http://google.com
|
230
|
+
html: |-
|
231
|
+
<p><a href="http://google.com">link</a></p>
|
data/test/test_parser.rb
CHANGED
@@ -15,16 +15,21 @@ class TestParser < Test::Unit::TestCase
|
|
15
15
|
assert RedCloth::VERSION.const_defined?("STRING")
|
16
16
|
end
|
17
17
|
|
18
|
+
def test_redcloth_version_to_s
|
19
|
+
assert_equal RedCloth::VERSION::STRING, RedCloth::VERSION.to_s
|
20
|
+
assert RedCloth::VERSION == RedCloth::VERSION::STRING
|
21
|
+
end
|
22
|
+
|
18
23
|
def test_badly_formatted_table_does_not_segfault
|
19
|
-
assert_match
|
24
|
+
assert_match(/td/, RedCloth.new(%Q{| one | two |\nthree | four |}).to_html)
|
20
25
|
end
|
21
26
|
|
22
27
|
def test_table_without_block_end_does_not_segfault
|
23
|
-
assert_match
|
28
|
+
assert_match(/h3/, RedCloth.new("| a | b |\n| c | d |\nh3. foo").to_html)
|
24
29
|
end
|
25
30
|
|
26
31
|
def test_table_with_empty_cells_does_not_segfault
|
27
|
-
assert_match
|
32
|
+
assert_match(/td/, RedCloth.new(%Q{|one || |\nthree | four |}).to_html)
|
28
33
|
end
|
29
34
|
|
30
35
|
def test_unfinished_html_block_does_not_segfault_with_filter_html
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RedCloth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-15 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description: RedCloth-4.0.
|
16
|
+
description: RedCloth-4.0.2 - Textile parser for Ruby. http://redcloth.org/
|
17
17
|
email: redcloth-upwards@rubyforge.org
|
18
18
|
executables:
|
19
19
|
- redcloth
|
@@ -101,6 +101,6 @@ rubyforge_project: redcloth
|
|
101
101
|
rubygems_version: 1.1.1
|
102
102
|
signing_key:
|
103
103
|
specification_version: 2
|
104
|
-
summary: RedCloth-4.0.
|
104
|
+
summary: RedCloth-4.0.2 - Textile parser for Ruby. http://redcloth.org/
|
105
105
|
test_files: []
|
106
106
|
|