RedCloth 4.1.1 → 4.1.9
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 +36 -0
- data/COPYING +1 -1
- data/README +32 -17
- data/Rakefile +1 -0
- data/RedCloth.gemspec +4 -7
- data/ext/redcloth_scan/redcloth.h +53 -22
- data/ext/redcloth_scan/redcloth_attributes.c +176 -172
- data/ext/redcloth_scan/redcloth_attributes.c.rl +2 -3
- data/ext/redcloth_scan/redcloth_attributes.java.rl +5 -6
- data/ext/redcloth_scan/redcloth_attributes.rl +2 -2
- data/ext/redcloth_scan/redcloth_common.rl +5 -1
- data/ext/redcloth_scan/redcloth_inline.c +14485 -7298
- data/ext/redcloth_scan/redcloth_inline.c.rl +48 -14
- data/ext/redcloth_scan/redcloth_inline.java.rl +36 -4
- data/ext/redcloth_scan/redcloth_inline.rl +11 -12
- data/ext/redcloth_scan/redcloth_scan.c +6436 -6228
- data/ext/redcloth_scan/redcloth_scan.c.rl +12 -14
- data/ext/redcloth_scan/redcloth_scan.java.rl +25 -3
- data/ext/redcloth_scan/redcloth_scan.rl +7 -12
- data/lib/redcloth/formatters/base.rb +26 -20
- data/lib/redcloth/formatters/html.rb +22 -30
- data/lib/redcloth/formatters/latex.rb +45 -17
- data/lib/redcloth/textile_doc.rb +1 -3
- data/lib/redcloth/version.rb +1 -1
- data/test/basic.yml +16 -2
- data/test/code.yml +6 -7
- data/test/html.yml +15 -1
- data/test/images.yml +23 -0
- data/test/links.yml +27 -1
- data/test/lists.yml +19 -1
- data/test/table.yml +73 -4
- data/test/test_custom_tags.rb +13 -1
- data/test/test_erb.rb +1 -1
- data/test/test_extensions.rb +1 -1
- data/test/test_formatters.rb +1 -1
- data/test/test_parser.rb +1 -1
- data/test/test_restrictions.rb +1 -1
- data/test/textism.yml +1 -1
- data/test/threshold.yml +1 -3
- data/test/validate_fixtures.rb +2 -1
- metadata +6 -15
data/CHANGELOG
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
=== 4.1.9 / February 20, 2009
|
2
|
+
|
3
|
+
* Make compatible with Ruby 1.9.
|
4
|
+
|
5
|
+
* Image URLs and image titles can now contain parentheses. #71
|
6
|
+
|
7
|
+
* Handle caps properly in link titles. #77
|
8
|
+
|
9
|
+
* Remove extra preformatted line breaks after extended block code. #79
|
10
|
+
|
11
|
+
* Fix inline <notextile> being recognized as block <notextile>. #81
|
12
|
+
|
13
|
+
* Allow leading spaces on lists for backward compatibility with RedCloth 3.x. #89
|
14
|
+
|
15
|
+
* Recognize deleted phrases when they start at the beginning of a line. #83
|
16
|
+
|
17
|
+
* Fix escaped <code> tag when it has the class attribute and is in a <pre> tag. #95
|
18
|
+
|
19
|
+
* Fix dimensions and primes for LaTeX. #103
|
20
|
+
|
21
|
+
* Don't allow square brackets inside lang attribute so double square brackets are interpreted like Textile 2 and RedCloth 3. #101
|
22
|
+
|
23
|
+
* Improve LaTeX output for tables. #96
|
24
|
+
|
25
|
+
* Fix bad parsing of bracketed image links (which would hang the interpreter in some cases). #97
|
26
|
+
|
27
|
+
* Handle links containing parentheses. Brackets are no longer required. #82 [Ryan Alyea]
|
28
|
+
|
29
|
+
* Made italics use the correct LaTeX tag: textit rather than emph. #98
|
30
|
+
|
31
|
+
* Fixed custom block signatures calling built-in Ruby String methods. #92
|
32
|
+
|
33
|
+
* Mentioned the three supported platforms and what's necessary to build RedCloth in the README file.
|
34
|
+
|
35
|
+
* Fixed a require problem that caused an error when you would gem check --test RedCloth. #91
|
36
|
+
|
1
37
|
=== 4.1.1 / November 19, 2008
|
2
38
|
|
3
39
|
* Added 'lib/case_sensitive_require' back into gemspec. It got left out in the conversion to echoe, so "require 'RedCloth'" didn't work. #88
|
data/COPYING
CHANGED
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Homepage:: http://redcloth.org
|
4
4
|
Author:: Jason Garber
|
5
|
-
Copyright:: (c)
|
5
|
+
Copyright:: (c) 2009 Jason Garber
|
6
6
|
License:: MIT
|
7
7
|
|
8
8
|
(See http://redcloth.org/textile/ for a Textile reference.)
|
@@ -15,10 +15,38 @@ RedCloth is a Ruby library for converting Textile into HTML.
|
|
15
15
|
|
16
16
|
RedCloth can be installed via RubyGems:
|
17
17
|
|
18
|
-
|
18
|
+
gem install RedCloth
|
19
|
+
|
20
|
+
It will install the appropriate Ruby, JRuby, or Win32 gem. If using JRuby, version 1.1.5 or greater is required.
|
21
|
+
|
22
|
+
== Compiling
|
23
|
+
|
24
|
+
If you just want to use RedCloth, you do NOT need to build/compile it. It is compiled from C sources automatically when you install the gem on the ruby platform. Binary gems are provided for JRuby and Win32 platforms.
|
25
|
+
|
26
|
+
RedCloth can be compiled with <tt>rake compile</tt>. Ragel 6.3 or greater and the
|
27
|
+
echoe gem are needed to build, compile, and package RedCloth. Again, Ragel and echoe are NOT needed to simply use RedCloth.
|
28
|
+
|
29
|
+
You can cross-compile for JRuby with rake java compile and for Win32 with rake mingw compile.
|
30
|
+
|
31
|
+
== Using RedCloth
|
32
|
+
|
33
|
+
RedCloth is simply an extension of the String class, which can handle
|
34
|
+
Textile formatting. Use it like a String and output HTML with its
|
35
|
+
RedCloth#to_html method.
|
36
|
+
|
37
|
+
Simple use:
|
38
|
+
text = "This is *my* text."
|
39
|
+
RedCloth.new(text).to_html
|
40
|
+
|
41
|
+
Multi-line example:
|
42
|
+
|
43
|
+
doc = RedCloth.new <<EOD
|
44
|
+
h2. Test document
|
45
|
+
|
46
|
+
Just a simple test.
|
47
|
+
EOD
|
48
|
+
puts doc.to_html
|
19
49
|
|
20
|
-
Or can be compiled from its Ragel source with <tt>rake compile</tt>. Ragel 6.2
|
21
|
-
or greater is required to build RedCloth.
|
22
50
|
|
23
51
|
== What is Textile?
|
24
52
|
|
@@ -140,17 +168,4 @@ Styles are applied with curly braces.
|
|
140
168
|
table{border:1px solid black}.
|
141
169
|
{background:#ddd;color:red}. |a|red|row|
|
142
170
|
|
143
|
-
== Using RedCloth
|
144
|
-
|
145
|
-
RedCloth is simply an extension of the String class, which can handle
|
146
|
-
Textile formatting. Use it like a String and output HTML with its
|
147
|
-
RedCloth#to_html method.
|
148
|
-
|
149
|
-
doc = RedCloth.new "
|
150
|
-
|
151
|
-
h2. Test document
|
152
|
-
|
153
|
-
Just a simple test."
|
154
|
-
|
155
|
-
puts doc.to_html
|
156
171
|
|
data/Rakefile
CHANGED
@@ -14,6 +14,7 @@ e = Echoe.new('RedCloth', RedCloth::VERSION.to_s) do |p|
|
|
14
14
|
p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
|
15
15
|
p.ruby_version = '>=1.8.4'
|
16
16
|
p.extension_pattern = nil
|
17
|
+
p.development_dependencies = [] # remove echoe from development dependencies
|
17
18
|
|
18
19
|
if Platform.gcc?
|
19
20
|
p.platform = 'x86-mswin32-60'
|
data/RedCloth.gemspec
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{RedCloth}
|
5
|
-
s.version = "4.1.
|
5
|
+
s.version = "4.1.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jason Garber"]
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2009-02-20}
|
10
10
|
s.default_executable = %q{redcloth}
|
11
|
-
s.description = %q{RedCloth-4.1.
|
11
|
+
s.description = %q{RedCloth-4.1.9 - Textile parser for Ruby. http://redcloth.org/}
|
12
12
|
s.email = %q{redcloth-upwards@rubyforge.org}
|
13
13
|
s.executables = ["redcloth"]
|
14
14
|
s.extensions = ["ext/redcloth_scan/extconf.rb"]
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.4")
|
22
22
|
s.rubyforge_project = %q{redcloth}
|
23
23
|
s.rubygems_version = %q{1.3.1}
|
24
|
-
s.summary = %q{RedCloth-4.1.
|
24
|
+
s.summary = %q{RedCloth-4.1.9 - Textile parser for Ruby. http://redcloth.org/}
|
25
25
|
s.test_files = ["test/test_custom_tags.rb", "test/test_erb.rb", "test/test_extensions.rb", "test/test_formatters.rb", "test/test_parser.rb", "test/test_restrictions.rb"]
|
26
26
|
|
27
27
|
if s.respond_to? :specification_version then
|
@@ -29,11 +29,8 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.specification_version = 2
|
30
30
|
|
31
31
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
32
|
-
s.add_development_dependency(%q<echoe>, [">= 0"])
|
33
32
|
else
|
34
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
35
33
|
end
|
36
34
|
else
|
37
|
-
s.add_dependency(%q<echoe>, [">= 0"])
|
38
35
|
end
|
39
36
|
end
|
@@ -1,14 +1,30 @@
|
|
1
1
|
#ifndef redcloth_h
|
2
2
|
#define redcloth_h
|
3
3
|
|
4
|
-
|
5
|
-
#
|
6
|
-
#define RSTRING_LEN(
|
4
|
+
#ifndef RARRAY_LEN
|
5
|
+
#define RARRAY_LEN(arr) RARRAY(arr)->len
|
6
|
+
#define RSTRING_LEN(str) RSTRING(str)->len
|
7
|
+
#define RSTRING_PTR(str) RSTRING(str)->ptr
|
7
8
|
#endif
|
8
|
-
|
9
|
-
|
9
|
+
|
10
|
+
|
11
|
+
// Different string conversions for ruby 1.8 and ruby 1.9. For 1.9,
|
12
|
+
// we need to set the encoding of the string.
|
13
|
+
|
14
|
+
// For Ruby 1.9
|
15
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
16
|
+
#include "ruby/encoding.h"
|
17
|
+
#define STR_NEW(p,n) rb_enc_str_new((p),(n),rb_utf8_encoding())
|
18
|
+
#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),rb_utf8_encoding())
|
19
|
+
|
20
|
+
// For Ruby 1.8
|
21
|
+
#else
|
22
|
+
#define STR_NEW(p,n) rb_str_new((p),(n))
|
23
|
+
#define STR_NEW2(p) rb_str_new2((p))
|
24
|
+
|
10
25
|
#endif
|
11
26
|
|
27
|
+
|
12
28
|
/* variable defs */
|
13
29
|
#ifndef redcloth_scan_c
|
14
30
|
extern VALUE super_ParseError, mRedCloth, super_RedCloth;
|
@@ -23,6 +39,7 @@ VALUE redcloth_inline2(VALUE, VALUE, VALUE);
|
|
23
39
|
VALUE redcloth_attribute_parser(int, VALUE, char *, char *);
|
24
40
|
VALUE redcloth_attributes(VALUE, VALUE);
|
25
41
|
VALUE redcloth_link_attributes(VALUE, VALUE);
|
42
|
+
VALUE red_parse_title(VALUE, VALUE);
|
26
43
|
VALUE redcloth_transform(VALUE, char *, char *, VALUE);
|
27
44
|
VALUE redcloth_transform2(VALUE, VALUE);
|
28
45
|
void red_inc(VALUE, VALUE);
|
@@ -35,14 +52,16 @@ VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
35
52
|
#define CLEAR_REGS() regs = rb_hash_new();
|
36
53
|
#define RESET_REG() reg = NULL
|
37
54
|
#define CAT(H) rb_str_cat(H, ts, te-ts)
|
38
|
-
#define CLEAR(H) H =
|
39
|
-
#define
|
55
|
+
#define CLEAR(H) H = STR_NEW2("")
|
56
|
+
#define RSTRIP_BANG(H) rb_funcall(H, rb_intern("rstrip!"), 0)
|
57
|
+
#define SET_PLAIN_BLOCK(T) plain_block = STR_NEW2(T)
|
40
58
|
#define RESET_TYPE(T) rb_hash_aset(regs, ID2SYM(rb_intern("type")), plain_block)
|
41
59
|
#define INLINE(H, T) rb_str_append(H, rb_funcall(self, rb_intern(T), 1, regs))
|
42
60
|
#define DONE(H) rb_str_append(html, H); CLEAR(H); CLEAR_REGS()
|
43
61
|
#define PASS(H, A, T) rb_str_append(H, red_pass(self, regs, ID2SYM(rb_intern(A)), rb_intern(T), refs))
|
44
62
|
#define PARSE_ATTR(A) red_parse_attr(self, regs, ID2SYM(rb_intern(A)))
|
45
63
|
#define PARSE_LINK_ATTR(A) red_parse_link_attr(self, regs, ID2SYM(rb_intern(A)))
|
64
|
+
#define PARSE_IMAGE_ATTR(A) red_parse_image_attr(self, regs, ID2SYM(rb_intern(A)))
|
46
65
|
#define PASS_CODE(H, A, T, O) rb_str_append(H, red_pass_code(self, regs, ID2SYM(rb_intern(A)), rb_intern(T)))
|
47
66
|
#define ADD_BLOCK() \
|
48
67
|
rb_str_append(html, red_block(self, regs, block, refs)); \
|
@@ -54,38 +73,36 @@ VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
54
73
|
#define IS_NOT_EXTENDED() NIL_P(extend)
|
55
74
|
#define ADD_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block); CLEAR_REGS()
|
56
75
|
#define ADD_EXTENDED_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block);
|
57
|
-
#define ASET(T, V) rb_hash_aset(regs, ID2SYM(rb_intern(T)),
|
76
|
+
#define ASET(T, V) rb_hash_aset(regs, ID2SYM(rb_intern(T)), STR_NEW2(V));
|
58
77
|
#define AINC(T) red_inc(regs, ID2SYM(rb_intern(T)));
|
59
78
|
#define SET_ATTRIBUTES() \
|
60
|
-
VALUE buf = Qnil; \
|
61
79
|
SET_ATTRIBUTE("class_buf", "class"); \
|
62
80
|
SET_ATTRIBUTE("id_buf", "id"); \
|
63
81
|
SET_ATTRIBUTE("lang_buf", "lang"); \
|
64
82
|
SET_ATTRIBUTE("style_buf", "style");
|
65
83
|
#define SET_ATTRIBUTE(B, A) \
|
66
|
-
|
67
|
-
if (buf != Qnil) rb_hash_aset(regs, ID2SYM(rb_intern(A)), buf);
|
84
|
+
if (rb_hash_aref(regs, ID2SYM(rb_intern(B))) != Qnil) rb_hash_aset(regs, ID2SYM(rb_intern(A)), rb_hash_aref(regs, ID2SYM(rb_intern(B))));
|
68
85
|
#define TRANSFORM(T) \
|
69
86
|
if (p > reg && reg >= ts) { \
|
70
87
|
VALUE str = redcloth_transform(self, reg, p, refs); \
|
71
88
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
72
|
-
|
89
|
+
/*printf("TRANSFORM(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
73
90
|
} else { \
|
74
91
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
75
92
|
}
|
76
93
|
#define STORE(T) \
|
77
94
|
if (p > reg && reg >= ts) { \
|
78
|
-
VALUE str =
|
95
|
+
VALUE str = STR_NEW(reg, p-reg); \
|
79
96
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
80
|
-
|
97
|
+
/*printf("STORE(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
81
98
|
} else { \
|
82
99
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
83
100
|
}
|
84
101
|
#define STORE_B(T) \
|
85
102
|
if (p > bck && bck >= ts) { \
|
86
|
-
VALUE str =
|
103
|
+
VALUE str = STR_NEW(bck, p-bck); \
|
87
104
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
88
|
-
|
105
|
+
/*printf("STORE_B(" T ") '%s' (p:'%s' reg:'%s')\n", RSTRING_PTR(str), p, reg);*/ \
|
89
106
|
} else { \
|
90
107
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), Qnil); \
|
91
108
|
}
|
@@ -94,8 +111,22 @@ VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
94
111
|
char punct = 1; \
|
95
112
|
while (p > reg && punct == 1) { \
|
96
113
|
switch (*(p - 1)) { \
|
114
|
+
case ')': \
|
115
|
+
{ /*needed to keep inside chars scoped for less memory usage*/\
|
116
|
+
char *temp_p = p - 1; \
|
117
|
+
char level = -1; \
|
118
|
+
while (temp_p > reg) { \
|
119
|
+
switch(*(temp_p - 1)) { \
|
120
|
+
case '(': ++level; break; \
|
121
|
+
case ')': --level; break; \
|
122
|
+
} \
|
123
|
+
--temp_p; \
|
124
|
+
} \
|
125
|
+
if (level == 0) { punct = 0; } else { --p; } \
|
126
|
+
} \
|
127
|
+
break; \
|
97
128
|
case '!': case '"': case '#': case '$': case '%': case ']': case '[': case '&': case '\'': \
|
98
|
-
case '*': case '+': case ',': case '-': case '.': case '
|
129
|
+
case '*': case '+': case ',': case '-': case '.': case '(': case ':': \
|
99
130
|
case ';': case '=': case '?': case '@': case '\\': case '^': case '_': \
|
100
131
|
case '`': case '|': case '~': p--; break; \
|
101
132
|
default: punct = 0; \
|
@@ -118,7 +149,7 @@ VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
118
149
|
{ \
|
119
150
|
rb_ary_store(list_index, nest-1, INT2NUM(aint + 1)); \
|
120
151
|
} \
|
121
|
-
if (nest >
|
152
|
+
if (nest > RARRAY_LEN(list_layout)) \
|
122
153
|
{ \
|
123
154
|
sprintf(listm, "%s_open", list_type); \
|
124
155
|
if (list_continue == 1) \
|
@@ -141,17 +172,17 @@ VALUE red_pass_code(VALUE, VALUE, VALUE, ID);
|
|
141
172
|
} \
|
142
173
|
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(nest)); \
|
143
174
|
rb_str_append(html, rb_funcall(self, rb_intern(listm), 1, regs)); \
|
144
|
-
rb_ary_store(list_layout, nest-1,
|
175
|
+
rb_ary_store(list_layout, nest-1, STR_NEW2(list_type)); \
|
145
176
|
CLEAR_REGS(); \
|
146
177
|
ASET("first", "true"); \
|
147
178
|
} \
|
148
179
|
LIST_CLOSE(); \
|
149
|
-
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(
|
180
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(RARRAY_LEN(list_layout))); \
|
150
181
|
ASET("type", "li_open")
|
151
182
|
#define LIST_CLOSE() \
|
152
|
-
while (nest <
|
183
|
+
while (nest < RARRAY_LEN(list_layout)) \
|
153
184
|
{ \
|
154
|
-
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(
|
185
|
+
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(RARRAY_LEN(list_layout))); \
|
155
186
|
VALUE end_list = rb_ary_pop(list_layout); \
|
156
187
|
if (!NIL_P(end_list)) \
|
157
188
|
{ \
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/*
|
3
3
|
* redcloth_attributes.c.rl
|
4
4
|
*
|
5
|
-
* Copyright (C)
|
5
|
+
* Copyright (C) 2009 Jason Garber
|
6
6
|
*/
|
7
7
|
#include <ruby.h>
|
8
8
|
#include "redcloth.h"
|
@@ -32,17 +32,17 @@ static const char _redcloth_attributes_actions[] = {
|
|
32
32
|
static const short _redcloth_attributes_key_offsets[] = {
|
33
33
|
0, 0, 6, 11, 13, 14, 15, 23,
|
34
34
|
29, 34, 38, 46, 53, 60, 66, 72,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
74, 82, 89, 90, 97, 103, 111, 118,
|
36
|
+
125, 131, 137, 142, 148, 156, 163, 170,
|
37
|
+
176, 182, 190, 197, 204, 210, 218, 225,
|
38
|
+
232, 238, 240, 242, 243, 244, 251, 257,
|
39
|
+
262, 270, 277, 284, 290, 292, 300, 307,
|
40
|
+
308, 315, 321, 323, 324, 331, 337, 345,
|
41
|
+
353, 359, 367, 375, 382, 389, 399, 406,
|
42
|
+
414, 422, 429, 436, 443, 450, 460, 466,
|
43
|
+
474, 482, 489, 496, 506, 513, 521, 529,
|
44
|
+
536, 543, 551, 559, 566, 573, 576, 582,
|
45
|
+
590, 598, 605, 612, 621, 629, 637, 644
|
46
46
|
};
|
47
47
|
|
48
48
|
static const char _redcloth_attributes_trans_keys[] = {
|
@@ -55,93 +55,95 @@ static const char _redcloth_attributes_trans_keys[] = {
|
|
55
55
|
32, 35, 41, 10, 13, 0, 9, 10,
|
56
56
|
32, 41, 11, 13, 0, 9, 32, 41,
|
57
57
|
10, 13, 0, 9, 10, 32, 11, 13,
|
58
|
-
93, 0, 9, 10, 32,
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
91, 93, 0, 9, 10, 32, 91, 93,
|
59
|
+
11, 13, 0, 9, 32, 91, 93, 10,
|
60
|
+
13, 125, 0, 9, 10, 32, 125, 11,
|
61
|
+
13, 0, 9, 32, 125, 10, 13, 0,
|
62
|
+
9, 10, 32, 35, 41, 11, 13, 0,
|
63
|
+
9, 32, 35, 41, 10, 13, 0, 9,
|
64
|
+
10, 32, 41, 11, 13, 0, 9, 32,
|
65
|
+
41, 10, 13, 0, 9, 10, 32, 11,
|
66
|
+
13, 0, 9, 32, 10, 13, 0, 9,
|
67
|
+
10, 32, 11, 13, 0, 9, 10, 32,
|
62
68
|
35, 41, 11, 13, 0, 9, 32, 35,
|
63
69
|
41, 10, 13, 0, 9, 10, 32, 41,
|
64
70
|
11, 13, 0, 9, 32, 41, 10, 13,
|
65
71
|
0, 9, 10, 32, 11, 13, 0, 9,
|
66
|
-
|
72
|
+
10, 32, 91, 93, 11, 13, 0, 9,
|
73
|
+
32, 91, 93, 10, 13, 0, 9, 10,
|
74
|
+
32, 125, 11, 13, 0, 9, 32, 125,
|
75
|
+
10, 13, 0, 9, 10, 32, 91, 93,
|
76
|
+
11, 13, 0, 9, 32, 91, 93, 10,
|
77
|
+
13, 0, 9, 10, 32, 125, 11, 13,
|
78
|
+
0, 9, 32, 125, 10, 13, 35, 41,
|
79
|
+
35, 41, 41, 41, 0, 32, 40, 91,
|
80
|
+
123, 9, 13, 0, 9, 10, 32, 11,
|
81
|
+
13, 0, 9, 32, 10, 13, 0, 9,
|
82
|
+
10, 32, 35, 41, 11, 13, 0, 9,
|
83
|
+
32, 35, 41, 10, 13, 0, 9, 10,
|
84
|
+
32, 41, 11, 13, 0, 9, 32, 41,
|
85
|
+
10, 13, 91, 93, 0, 9, 10, 32,
|
86
|
+
91, 93, 11, 13, 0, 9, 32, 91,
|
87
|
+
93, 10, 13, 125, 0, 9, 10, 32,
|
88
|
+
125, 11, 13, 0, 9, 32, 125, 10,
|
89
|
+
13, 91, 93, 125, 0, 32, 40, 91,
|
90
|
+
123, 9, 13, 0, 9, 10, 32, 11,
|
67
91
|
13, 0, 9, 10, 32, 35, 41, 11,
|
68
|
-
13, 0, 9, 32, 35, 41,
|
69
|
-
0, 9, 10, 32,
|
70
|
-
9, 32, 41, 10, 13, 0, 9, 10,
|
71
|
-
32, 11, 13, 0, 9, 10, 32, 93,
|
72
|
-
11, 13, 0, 9, 32, 93, 10, 13,
|
73
|
-
0, 9, 10, 32, 125, 11, 13, 0,
|
74
|
-
9, 32, 125, 10, 13, 0, 9, 10,
|
75
|
-
32, 93, 11, 13, 0, 9, 32, 93,
|
76
|
-
10, 13, 0, 9, 10, 32, 125, 11,
|
77
|
-
13, 0, 9, 32, 125, 10, 13, 35,
|
78
|
-
41, 35, 41, 41, 41, 0, 32, 40,
|
79
|
-
91, 123, 9, 13, 0, 9, 10, 32,
|
80
|
-
11, 13, 0, 9, 32, 10, 13, 0,
|
92
|
+
13, 0, 9, 10, 32, 35, 41, 11,
|
93
|
+
13, 0, 9, 10, 32, 11, 13, 0,
|
81
94
|
9, 10, 32, 35, 41, 11, 13, 0,
|
82
|
-
9, 32, 35, 41,
|
83
|
-
10, 32, 41, 11, 13, 0, 9,
|
84
|
-
41,
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
10, 32, 35, 41, 11, 13, 0, 9,
|
92
|
-
10, 32, 11, 13, 0, 9, 10, 32,
|
93
|
-
35, 41, 11, 13, 0, 9, 10, 32,
|
94
|
-
35, 41, 11, 13, 0, 9, 10, 32,
|
95
|
+
9, 10, 32, 35, 41, 11, 13, 0,
|
96
|
+
9, 10, 32, 41, 11, 13, 0, 9,
|
97
|
+
10, 32, 41, 11, 13, 0, 9, 10,
|
98
|
+
32, 40, 46, 91, 123, 11, 13, 0,
|
99
|
+
9, 10, 32, 46, 11, 13, 0, 9,
|
100
|
+
10, 32, 91, 93, 11, 13, 0, 9,
|
101
|
+
10, 32, 91, 93, 11, 13, 0, 9,
|
102
|
+
10, 32, 125, 11, 13, 0, 9, 10,
|
103
|
+
32, 125, 11, 13, 0, 9, 10, 32,
|
95
104
|
41, 11, 13, 0, 9, 10, 32, 41,
|
96
105
|
11, 13, 0, 9, 10, 32, 40, 46,
|
97
106
|
91, 123, 11, 13, 0, 9, 10, 32,
|
98
|
-
|
99
|
-
11, 13, 0, 9, 10, 32,
|
107
|
+
11, 13, 0, 9, 10, 32, 35, 41,
|
108
|
+
11, 13, 0, 9, 10, 32, 35, 41,
|
109
|
+
11, 13, 0, 9, 10, 32, 41, 11,
|
110
|
+
13, 0, 9, 10, 32, 41, 11, 13,
|
111
|
+
0, 9, 10, 32, 40, 46, 91, 123,
|
112
|
+
11, 13, 0, 9, 10, 32, 46, 11,
|
113
|
+
13, 0, 9, 10, 32, 91, 93, 11,
|
114
|
+
13, 0, 9, 10, 32, 91, 93, 11,
|
100
115
|
13, 0, 9, 10, 32, 125, 11, 13,
|
101
116
|
0, 9, 10, 32, 125, 11, 13, 0,
|
102
|
-
9, 10, 32,
|
117
|
+
9, 10, 32, 91, 93, 11, 13, 0,
|
118
|
+
9, 10, 32, 91, 93, 11, 13, 0,
|
119
|
+
9, 10, 32, 125, 11, 13, 0, 9,
|
120
|
+
10, 32, 125, 11, 13, 40, 91, 123,
|
121
|
+
0, 9, 10, 32, 11, 13, 0, 9,
|
122
|
+
10, 32, 35, 41, 11, 13, 0, 9,
|
123
|
+
10, 32, 35, 41, 11, 13, 0, 9,
|
103
124
|
10, 32, 41, 11, 13, 0, 9, 10,
|
104
|
-
32, 40, 46, 91, 123, 11, 13, 0,
|
105
|
-
9, 10, 32, 11, 13, 0, 9, 10,
|
106
|
-
32, 35, 41, 11, 13, 0, 9, 10,
|
107
|
-
32, 35, 41, 11, 13, 0, 9, 10,
|
108
|
-
32, 41, 11, 13, 0, 9, 10, 32,
|
109
|
-
41, 11, 13, 0, 9, 10, 32, 40,
|
110
|
-
46, 91, 123, 11, 13, 0, 9, 10,
|
111
|
-
32, 46, 11, 13, 0, 9, 10, 32,
|
112
|
-
93, 11, 13, 0, 9, 10, 32, 93,
|
113
|
-
11, 13, 0, 9, 10, 32, 125, 11,
|
114
|
-
13, 0, 9, 10, 32, 125, 11, 13,
|
115
|
-
0, 9, 10, 32, 93, 11, 13, 0,
|
116
|
-
9, 10, 32, 93, 11, 13, 0, 9,
|
117
|
-
10, 32, 125, 11, 13, 0, 9, 10,
|
118
|
-
32, 125, 11, 13, 40, 91, 123, 0,
|
119
|
-
9, 10, 32, 11, 13, 0, 9, 10,
|
120
|
-
32, 35, 41, 11, 13, 0, 9, 10,
|
121
|
-
32, 35, 41, 11, 13, 0, 9, 10,
|
122
125
|
32, 41, 11, 13, 0, 9, 10, 32,
|
123
|
-
|
124
|
-
91,
|
125
|
-
93, 11, 13, 0, 9, 10,
|
126
|
-
11, 13, 0, 9, 10, 32,
|
127
|
-
|
128
|
-
0
|
126
|
+
40, 91, 123, 11, 13, 0, 9, 10,
|
127
|
+
32, 91, 93, 11, 13, 0, 9, 10,
|
128
|
+
32, 91, 93, 11, 13, 0, 9, 10,
|
129
|
+
32, 125, 11, 13, 0, 9, 10, 32,
|
130
|
+
125, 11, 13, 0
|
129
131
|
};
|
130
132
|
|
131
133
|
static const char _redcloth_attributes_single_lengths[] = {
|
132
134
|
0, 4, 3, 2, 1, 1, 6, 4,
|
133
|
-
3, 2, 6, 5, 5, 4, 4,
|
134
|
-
|
135
|
+
3, 2, 6, 5, 5, 4, 4, 2,
|
136
|
+
6, 5, 1, 5, 4, 6, 5, 5,
|
135
137
|
4, 4, 3, 4, 6, 5, 5, 4,
|
136
|
-
4,
|
138
|
+
4, 6, 5, 5, 4, 6, 5, 5,
|
137
139
|
4, 2, 2, 1, 1, 5, 4, 3,
|
138
|
-
6, 5, 5, 4,
|
139
|
-
5, 4,
|
140
|
-
4, 6, 6, 5, 5, 8, 5,
|
141
|
-
|
142
|
-
6, 5, 5, 8, 5,
|
143
|
-
5,
|
144
|
-
6, 5, 5, 7,
|
140
|
+
6, 5, 5, 4, 2, 6, 5, 1,
|
141
|
+
5, 4, 2, 1, 5, 4, 6, 6,
|
142
|
+
4, 6, 6, 5, 5, 8, 5, 6,
|
143
|
+
6, 5, 5, 5, 5, 8, 4, 6,
|
144
|
+
6, 5, 5, 8, 5, 6, 6, 5,
|
145
|
+
5, 6, 6, 5, 5, 3, 4, 6,
|
146
|
+
6, 5, 5, 7, 6, 6, 5, 5
|
145
147
|
};
|
146
148
|
|
147
149
|
static const char _redcloth_attributes_range_lengths[] = {
|
@@ -163,17 +165,17 @@ static const char _redcloth_attributes_range_lengths[] = {
|
|
163
165
|
static const short _redcloth_attributes_index_offsets[] = {
|
164
166
|
0, 0, 6, 11, 14, 16, 18, 26,
|
165
167
|
32, 37, 41, 49, 56, 63, 69, 75,
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
168
|
+
78, 86, 93, 95, 102, 108, 116, 123,
|
169
|
+
130, 136, 142, 147, 153, 161, 168, 175,
|
170
|
+
181, 187, 195, 202, 209, 215, 223, 230,
|
171
|
+
237, 243, 246, 249, 251, 253, 260, 266,
|
172
|
+
271, 279, 286, 293, 299, 302, 310, 317,
|
173
|
+
319, 326, 332, 335, 337, 344, 350, 358,
|
174
|
+
366, 372, 380, 388, 395, 402, 412, 419,
|
175
|
+
427, 435, 442, 449, 456, 463, 473, 479,
|
176
|
+
487, 495, 502, 509, 519, 526, 534, 542,
|
177
|
+
549, 556, 564, 572, 579, 586, 590, 596,
|
178
|
+
604, 612, 619, 626, 635, 643, 651, 658
|
177
179
|
};
|
178
180
|
|
179
181
|
static const unsigned char _redcloth_attributes_indicies[] = {
|
@@ -186,78 +188,81 @@ static const unsigned char _redcloth_attributes_indicies[] = {
|
|
186
188
|
21, 5, 22, 22, 24, 25, 5, 21,
|
187
189
|
9, 27, 28, 27, 29, 9, 26, 9,
|
188
190
|
27, 27, 29, 9, 26, 17, 19, 20,
|
189
|
-
30, 17, 11, 32, 31, 31, 34,
|
190
|
-
34, 36, 31, 33, 31, 34,
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
53,
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
63,
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
80, 82, 37, 79,
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
107, 109, 91, 106,
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
191
|
+
30, 17, 11, 4, 32, 31, 31, 34,
|
192
|
+
35, 34, 18, 36, 31, 33, 31, 34,
|
193
|
+
34, 18, 36, 31, 33, 38, 37, 37,
|
194
|
+
40, 41, 40, 42, 37, 39, 37, 40,
|
195
|
+
40, 42, 37, 39, 5, 44, 45, 44,
|
196
|
+
46, 47, 5, 43, 5, 44, 44, 46,
|
197
|
+
47, 5, 43, 9, 49, 50, 49, 51,
|
198
|
+
9, 48, 9, 49, 49, 51, 9, 48,
|
199
|
+
17, 53, 54, 53, 17, 52, 17, 53,
|
200
|
+
53, 17, 52, 0, 2, 3, 56, 0,
|
201
|
+
55, 5, 58, 59, 58, 60, 61, 5,
|
202
|
+
57, 5, 58, 58, 60, 61, 5, 57,
|
203
|
+
9, 63, 64, 63, 65, 9, 62, 9,
|
204
|
+
63, 63, 65, 9, 62, 17, 53, 54,
|
205
|
+
66, 17, 55, 31, 68, 69, 68, 52,
|
206
|
+
70, 31, 67, 31, 68, 68, 52, 70,
|
207
|
+
31, 67, 37, 72, 73, 72, 74, 37,
|
208
|
+
71, 37, 72, 72, 74, 37, 71, 31,
|
209
|
+
76, 77, 76, 1, 78, 31, 75, 31,
|
210
|
+
76, 76, 1, 78, 31, 75, 37, 80,
|
211
|
+
81, 80, 82, 37, 79, 37, 80, 80,
|
212
|
+
82, 37, 79, 84, 85, 83, 88, 89,
|
213
|
+
87, 86, 90, 92, 91, 86, 86, 94,
|
214
|
+
95, 96, 86, 93, 97, 99, 100, 99,
|
215
|
+
97, 98, 97, 99, 99, 97, 98, 87,
|
216
|
+
102, 103, 102, 104, 105, 87, 101, 87,
|
217
|
+
102, 102, 104, 105, 87, 101, 91, 107,
|
218
|
+
108, 107, 109, 91, 106, 91, 107, 107,
|
219
|
+
109, 91, 106, 86, 111, 110, 110, 113,
|
220
|
+
114, 113, 98, 115, 110, 112, 110, 113,
|
221
|
+
113, 98, 115, 110, 112, 117, 116, 116,
|
222
|
+
119, 120, 119, 121, 116, 118, 116, 119,
|
223
|
+
119, 121, 116, 118, 123, 123, 122, 123,
|
224
|
+
124, 123, 123, 126, 127, 128, 123, 125,
|
225
|
+
129, 2, 3, 2, 129, 1, 131, 132,
|
226
|
+
133, 132, 134, 135, 131, 130, 136, 44,
|
227
|
+
45, 44, 46, 47, 136, 43, 137, 19,
|
228
|
+
20, 19, 137, 18, 139, 140, 141, 140,
|
229
|
+
142, 143, 139, 138, 5, 22, 23, 22,
|
230
|
+
24, 25, 5, 21, 8, 145, 146, 145,
|
231
|
+
18, 8, 144, 9, 27, 28, 27, 29,
|
232
|
+
9, 26, 137, 19, 20, 30, 13, 14,
|
233
|
+
15, 16, 137, 11, 137, 19, 20, 30,
|
234
|
+
14, 137, 11, 148, 149, 150, 149, 18,
|
235
|
+
18, 148, 147, 31, 34, 35, 34, 18,
|
236
|
+
36, 31, 33, 152, 153, 154, 153, 18,
|
237
|
+
152, 151, 37, 40, 41, 40, 42, 37,
|
238
|
+
39, 156, 157, 158, 157, 1, 156, 155,
|
239
|
+
159, 49, 50, 49, 51, 159, 48, 129,
|
240
|
+
2, 3, 56, 160, 161, 162, 163, 129,
|
241
|
+
55, 164, 53, 54, 53, 164, 52, 131,
|
242
|
+
166, 167, 166, 168, 169, 131, 165, 136,
|
243
|
+
58, 59, 58, 60, 61, 136, 57, 156,
|
244
|
+
171, 172, 171, 52, 156, 170, 159, 63,
|
245
|
+
64, 63, 65, 159, 62, 164, 53, 54,
|
246
|
+
66, 160, 161, 162, 163, 164, 55, 164,
|
247
|
+
53, 54, 66, 161, 164, 55, 174, 175,
|
248
|
+
176, 175, 52, 52, 174, 173, 177, 68,
|
249
|
+
69, 68, 52, 70, 177, 67, 179, 180,
|
250
|
+
181, 180, 52, 179, 178, 182, 72, 73,
|
251
|
+
72, 74, 182, 71, 174, 184, 185, 184,
|
252
|
+
1, 1, 174, 183, 177, 76, 77, 76,
|
253
|
+
1, 78, 177, 75, 179, 187, 188, 187,
|
254
|
+
1, 179, 186, 182, 80, 81, 80, 82,
|
255
|
+
182, 79, 189, 190, 191, 123, 192, 99,
|
256
|
+
100, 99, 192, 98, 83, 194, 195, 194,
|
257
|
+
196, 197, 83, 193, 87, 102, 103, 102,
|
258
|
+
104, 105, 87, 101, 90, 199, 200, 199,
|
259
|
+
98, 90, 198, 91, 107, 108, 107, 109,
|
260
|
+
91, 106, 192, 99, 100, 99, 94, 95,
|
261
|
+
96, 192, 93, 122, 202, 203, 202, 98,
|
262
|
+
98, 122, 201, 110, 113, 114, 113, 98,
|
263
|
+
115, 110, 112, 124, 205, 206, 205, 98,
|
264
|
+
124, 204, 116, 119, 120, 119, 121, 116,
|
265
|
+
118, 0
|
261
266
|
};
|
262
267
|
|
263
268
|
static const char _redcloth_attributes_trans_targs[] = {
|
@@ -382,24 +387,23 @@ redcloth_attribute_parser(machine, self, p, pe)
|
|
382
387
|
char *p, *pe;
|
383
388
|
{
|
384
389
|
int cs, act;
|
385
|
-
char *ts, *te, *reg, *bck, *eof;
|
390
|
+
char *ts = 0, *te = 0, *reg = 0, *bck = NULL, *eof = NULL;
|
386
391
|
VALUE regs = rb_hash_new();
|
387
|
-
VALUE buf = Qnil;
|
388
392
|
|
389
393
|
|
390
|
-
#line
|
394
|
+
#line 395 "ext/redcloth_scan/redcloth_attributes.c"
|
391
395
|
{
|
392
396
|
cs = redcloth_attributes_start;
|
393
397
|
ts = 0;
|
394
398
|
te = 0;
|
395
399
|
act = 0;
|
396
400
|
}
|
397
|
-
#line
|
401
|
+
#line 31 "ext/redcloth_scan/redcloth_attributes.c.rl"
|
398
402
|
|
399
403
|
cs = machine;
|
400
404
|
|
401
405
|
|
402
|
-
#line
|
406
|
+
#line 407 "ext/redcloth_scan/redcloth_attributes.c"
|
403
407
|
{
|
404
408
|
int _klen;
|
405
409
|
unsigned int _trans;
|
@@ -420,7 +424,7 @@ _resume:
|
|
420
424
|
#line 1 "ext/redcloth_scan/redcloth_attributes.c.rl"
|
421
425
|
{ts = p;}
|
422
426
|
break;
|
423
|
-
#line
|
427
|
+
#line 428 "ext/redcloth_scan/redcloth_attributes.c"
|
424
428
|
}
|
425
429
|
}
|
426
430
|
|
@@ -590,7 +594,7 @@ _eof_trans:
|
|
590
594
|
}
|
591
595
|
}
|
592
596
|
break;
|
593
|
-
#line
|
597
|
+
#line 598 "ext/redcloth_scan/redcloth_attributes.c"
|
594
598
|
}
|
595
599
|
}
|
596
600
|
|
@@ -607,7 +611,7 @@ _again:
|
|
607
611
|
#line 1 "ext/redcloth_scan/redcloth_attributes.c.rl"
|
608
612
|
{act = 0;}
|
609
613
|
break;
|
610
|
-
#line
|
614
|
+
#line 615 "ext/redcloth_scan/redcloth_attributes.c"
|
611
615
|
}
|
612
616
|
}
|
613
617
|
|
@@ -626,7 +630,7 @@ _again:
|
|
626
630
|
|
627
631
|
_out: {}
|
628
632
|
}
|
629
|
-
#line
|
633
|
+
#line 35 "ext/redcloth_scan/redcloth_attributes.c.rl"
|
630
634
|
|
631
635
|
return regs;
|
632
636
|
}
|