BBRedCloth 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/BBRedCloth.gemspec +13 -15
- data/ext/redcloth_scan/redcloth.h +24 -8
- data/ext/redcloth_scan/redcloth_bbcode.c +14 -14
- data/ext/redcloth_scan/redcloth_bbcode.c.rl +3 -3
- data/ext/redcloth_scan/redcloth_bbcode.rl +6 -6
- data/ext/redcloth_scan/redcloth_bbcode_inline.c +6 -6
- data/ext/redcloth_scan/redcloth_bbcode_inline.c.rl +3 -3
- data/ext/redcloth_scan/redcloth_bbcode_inline.rl +1 -1
- data/ext/redcloth_scan/redcloth_inline.c +12 -12
- data/ext/redcloth_scan/redcloth_inline.c.rl +9 -9
- data/ext/redcloth_scan/redcloth_scan.c +19 -19
- data/ext/redcloth_scan/redcloth_scan.c.rl +8 -8
- data/ext/redcloth_scan/redcloth_scan.rl +6 -6
- data/lib/redcloth/version.rb +1 -1
- data/test/helper.rb +12 -12
- data/test/test_custom_tags.rb +1 -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
- metadata +6 -22
data/BBRedCloth.gemspec
CHANGED
@@ -2,30 +2,28 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{BBRedCloth}
|
5
|
-
s.version = "0.8.
|
5
|
+
s.version = "0.8.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date = %q{2011-
|
10
|
-
s.
|
11
|
-
s.description = %q{BBRedCloth-0.8.4 - Textile parser for Ruby. Includes BBCode additions.
|
8
|
+
s.authors = [%q{Ryan Alyea}]
|
9
|
+
s.date = %q{2011-09-02}
|
10
|
+
s.description = %q{BBRedCloth-0.8.5 - Textile parser for Ruby. Includes BBCode additions.
|
12
11
|
http://redcloth.org/}
|
13
12
|
s.email = %q{ryan@fangamer.com}
|
14
|
-
s.executables = [
|
15
|
-
s.extensions = [
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
s.files = [
|
13
|
+
s.executables = [%q{redcloth}]
|
14
|
+
s.extensions = [%q{ext/redcloth_scan/extconf.rb}]
|
15
|
+
s.extra_rdoc_files = [%q{CHANGELOG}, %q{lib/case_sensitive_require/RedCloth.rb}, %q{lib/redcloth/erb_extension.rb}, %q{lib/redcloth/formatters/base.rb}, %q{lib/redcloth/formatters/html.rb}, %q{lib/redcloth/formatters/latex.rb}, %q{lib/redcloth/textile_doc.rb}, %q{lib/redcloth/version.rb}, %q{lib/redcloth.rb}, %q{README.textile}]
|
16
|
+
s.files = [%q{bin/redcloth}, %q{CHANGELOG}, %q{COPYING}, %q{ext/mingw-rbconfig.rb}, %q{ext/redcloth_scan/extconf.rb}, %q{ext/redcloth_scan/redcloth.h}, %q{ext/redcloth_scan/redcloth_attributes.c.rl}, %q{ext/redcloth_scan/redcloth_attributes.java.rl}, %q{ext/redcloth_scan/redcloth_attributes.rl}, %q{ext/redcloth_scan/redcloth_bbcode.c.rl}, %q{ext/redcloth_scan/redcloth_bbcode.rl}, %q{ext/redcloth_scan/redcloth_bbcode_inline.rl}, %q{ext/redcloth_scan/redcloth_bbcode_inline.c.rl}, %q{ext/redcloth_scan/redcloth_common.c.rl}, %q{ext/redcloth_scan/redcloth_common.java.rl}, %q{ext/redcloth_scan/redcloth_common.rl}, %q{ext/redcloth_scan/redcloth_inline.c.rl}, %q{ext/redcloth_scan/redcloth_inline.java.rl}, %q{ext/redcloth_scan/redcloth_inline.rl}, %q{ext/redcloth_scan/redcloth_scan.c.rl}, %q{ext/redcloth_scan/redcloth_scan.java.rl}, %q{ext/redcloth_scan/redcloth_scan.rl}, %q{extras/ragel_profiler.rb}, %q{lib/case_sensitive_require/RedCloth.rb}, %q{lib/redcloth/erb_extension.rb}, %q{lib/redcloth/formatters/base.rb}, %q{lib/redcloth/formatters/html.rb}, %q{lib/redcloth/formatters/latex.rb}, %q{lib/redcloth/formatters/latex_entities.yml}, %q{lib/redcloth/textile_doc.rb}, %q{lib/redcloth/version.rb}, %q{lib/redcloth.rb}, %q{Manifest}, %q{Rakefile}, %q{README.textile}, %q{setup.rb}, %q{test/basic.yml}, %q{test/code.yml}, %q{test/definitions.yml}, %q{test/extra_whitespace.yml}, %q{test/filter_html.yml}, %q{test/filter_pba.yml}, %q{test/helper.rb}, %q{test/html.yml}, %q{test/images.yml}, %q{test/instiki.yml}, %q{test/links.yml}, %q{test/lists.yml}, %q{test/poignant.yml}, %q{test/sanitize_html.yml}, %q{test/table.yml}, %q{test/test_custom_tags.rb}, %q{test/test_erb.rb}, %q{test/test_extensions.rb}, %q{test/test_formatters.rb}, %q{test/test_parser.rb}, %q{test/test_restrictions.rb}, %q{test/textism.yml}, %q{test/threshold.yml}, %q{test/validate_fixtures.rb}, %q{BBRedCloth.gemspec}, %q{ext/redcloth_scan/redcloth_attributes.c}, %q{ext/redcloth_scan/redcloth_inline.c}, %q{ext/redcloth_scan/redcloth_scan.c}, %q{ext/redcloth_scan/redcloth_bbcode.c}, %q{ext/redcloth_scan/redcloth_bbcode_inline.c}]
|
18
17
|
s.homepage = %q{http://redcloth.org}
|
19
|
-
s.rdoc_options = [
|
20
|
-
s.require_paths = [
|
18
|
+
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{BBRedCloth}, %q{--main}, %q{README.textile}]
|
19
|
+
s.require_paths = [%q{lib}, %q{ext}, %q{lib/case_sensitive_require}]
|
21
20
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.4")
|
22
21
|
s.rubyforge_project = %q{bbredcloth}
|
23
|
-
s.rubygems_version = %q{1.
|
24
|
-
s.summary = %q{BBRedCloth-0.8.
|
25
|
-
s.test_files = [
|
22
|
+
s.rubygems_version = %q{1.8.7}
|
23
|
+
s.summary = %q{BBRedCloth-0.8.5 - Textile parser for Ruby. Includes BBCode additions. http://redcloth.org/}
|
24
|
+
s.test_files = [%q{test/test_custom_tags.rb}, %q{test/test_erb.rb}, %q{test/test_extensions.rb}, %q{test/test_formatters.rb}, %q{test/test_parser.rb}, %q{test/test_restrictions.rb}]
|
26
25
|
|
27
26
|
if s.respond_to? :specification_version then
|
28
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
29
27
|
s.specification_version = 3
|
30
28
|
|
31
29
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
@@ -15,6 +15,22 @@
|
|
15
15
|
#define RARRAY_PTR(x) (RARRAY(x)->ptr)
|
16
16
|
#endif
|
17
17
|
|
18
|
+
// Different string conversions for ruby 1.8 and ruby 1.9. For 1.9,
|
19
|
+
// we need to set the encoding of the string.
|
20
|
+
|
21
|
+
// For Ruby 1.9
|
22
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
23
|
+
#include "ruby/encoding.h"
|
24
|
+
#define STR_NEW(p,n) rb_enc_str_new((p),(n),rb_utf8_encoding())
|
25
|
+
#define STR_NEW2(p) rb_enc_str_new((p),strlen(p),rb_utf8_encoding())
|
26
|
+
|
27
|
+
// For Ruby 1.8
|
28
|
+
#else
|
29
|
+
#define STR_NEW(p,n) rb_str_new((p),(n))
|
30
|
+
#define STR_NEW2(p) rb_str_new2((p))
|
31
|
+
|
32
|
+
#endif
|
33
|
+
|
18
34
|
/* variable defs */
|
19
35
|
#ifndef redcloth_scan_c
|
20
36
|
extern VALUE super_ParseError, mRedCloth, super_RedCloth;
|
@@ -49,18 +65,18 @@ VALUE redcloth_bbcode_inline2(VALUE, VALUE, VALUE);
|
|
49
65
|
if (rb_funcall(rb_funcall(self, rb_intern("disable_inline"), 0),rb_intern("include?"), 1,ID2SYM(rb_intern(#T))) != Qtrue) { F }
|
50
66
|
#define UNLESS_DISABLED_INLINE(H, T, F) \
|
51
67
|
if (rb_funcall(rb_funcall(self, rb_intern("disable_inline"), 0),rb_intern("include?"), 1,ID2SYM(rb_intern(#T))) == Qtrue) { rb_str_append(H,red_passthrough(self, ts, te, refs)); } \
|
52
|
-
else { /*VALUE test =
|
68
|
+
else { /*VALUE test = STR_NEW(ts,te-ts); printf("\nred_passthrough_else() '%s'\n", RSTRING(test)->ptr);*/ F }
|
53
69
|
#define UNLESS_DISABLED_ATTRIBUTE(T, F) \
|
54
70
|
if (!(rb_funcall(rb_funcall(self, rb_intern("disable_inline"), 0),rb_intern("include?"), 1,ID2SYM(rb_intern(#T))) == Qtrue)) { F } //if !(rb_funcall(rb_funcall(self, rb_intern("disable_inline"), 0),rb_intern("include?"), 1,ID2SYM(rb_intern(#T))) == Qtrue) { F }
|
55
71
|
#define CLEAR_REGS() regs = rb_hash_new();
|
56
72
|
#define RESET_REG() reg = NULL
|
57
73
|
#define CAT(H) rb_str_cat(H, ts, te-ts)
|
58
|
-
#define CLEAR(H) H =
|
59
|
-
#define SET_PLAIN_BLOCK(T) plain_block =
|
74
|
+
#define CLEAR(H) H = STR_NEW2("")
|
75
|
+
#define SET_PLAIN_BLOCK(T) plain_block = STR_NEW2(T)
|
60
76
|
#define RESET_TYPE(T) rb_hash_aset(regs, ID2SYM(rb_intern("type")), plain_block)
|
61
77
|
#define INLINE(H, T) rb_str_append(H, rb_funcall(self, rb_intern(T), 1, regs))
|
62
78
|
#define DONE(H) rb_str_append(html, H); CLEAR(H); CLEAR_REGS()
|
63
|
-
#define BBDONE() failed_start =
|
79
|
+
#define BBDONE() failed_start = STR_NEW2(""); html = STR_NEW2(""); CLEAR_REGS(); RESET_REG();
|
64
80
|
#define PASS(H, A, T) rb_str_append(H, red_pass(self, regs, ID2SYM(rb_intern(A)), rb_intern(T), refs))
|
65
81
|
#define PARSE_ATTR(A) red_parse_attr(self, regs, ID2SYM(rb_intern(A)))
|
66
82
|
#define PARSE_LINK_ATTR(A) red_parse_link_attr(self, regs, ID2SYM(rb_intern(A)))
|
@@ -75,7 +91,7 @@ VALUE redcloth_bbcode_inline2(VALUE, VALUE, VALUE);
|
|
75
91
|
#define IS_NOT_EXTENDED() NIL_P(extend)
|
76
92
|
#define ADD_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block); CLEAR_REGS()
|
77
93
|
#define ADD_EXTENDED_BLOCKCODE() rb_str_append(html, red_blockcode(self, regs, block)); CLEAR(block);
|
78
|
-
#define ASET(T, V) rb_hash_aset(regs, ID2SYM(rb_intern(T)),
|
94
|
+
#define ASET(T, V) rb_hash_aset(regs, ID2SYM(rb_intern(T)), STR_NEW2(V));
|
79
95
|
#define AINC(T) red_inc(regs, ID2SYM(rb_intern(T)));
|
80
96
|
#define SET_ATTRIBUTES() \
|
81
97
|
VALUE buf = Qnil; \
|
@@ -96,7 +112,7 @@ VALUE redcloth_bbcode_inline2(VALUE, VALUE, VALUE);
|
|
96
112
|
}
|
97
113
|
#define STORE(T) \
|
98
114
|
if (p > reg && reg >= ts) { \
|
99
|
-
VALUE str =
|
115
|
+
VALUE str = STR_NEW(reg, p-reg); \
|
100
116
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
101
117
|
/* printf("STORE(" T ") '%s' (p:'%d' reg:'%d')\n", RSTRING(str)->ptr, p, reg);*/ \
|
102
118
|
} else { \
|
@@ -104,7 +120,7 @@ VALUE redcloth_bbcode_inline2(VALUE, VALUE, VALUE);
|
|
104
120
|
}
|
105
121
|
#define STORE_B(T) \
|
106
122
|
if (p > bck && bck >= ts) { \
|
107
|
-
VALUE str =
|
123
|
+
VALUE str = STR_NEW(bck, p-bck); \
|
108
124
|
rb_hash_aset(regs, ID2SYM(rb_intern(T)), str); \
|
109
125
|
/* printf("STORE_B(" T ") '%s' (p:'%d' reg:'%d')\n", RSTRING(str)->ptr, p, reg);*/ \
|
110
126
|
} else { \
|
@@ -177,7 +193,7 @@ VALUE redcloth_bbcode_inline2(VALUE, VALUE, VALUE);
|
|
177
193
|
} \
|
178
194
|
rb_hash_aset(regs, ID2SYM(rb_intern("nest")), INT2NUM(nest)); \
|
179
195
|
rb_str_append(html, rb_funcall(self, rb_intern(listm), 1, regs)); \
|
180
|
-
rb_ary_store(list_layout, nest-1,
|
196
|
+
rb_ary_store(list_layout, nest-1, STR_NEW2(list_type)); \
|
181
197
|
CLEAR_REGS(); \
|
182
198
|
ASET("first", "true"); \
|
183
199
|
} \
|
@@ -1539,14 +1539,14 @@ redcloth_bbcode(self, p, pe, refs)
|
|
1539
1539
|
int cs, act, nest;
|
1540
1540
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
1541
1541
|
char *orig_p = p, *orig_pe = pe;
|
1542
|
-
VALUE block =
|
1542
|
+
VALUE block = STR_NEW2("");
|
1543
1543
|
VALUE regs = Qnil; CLEAR_REGS()
|
1544
1544
|
unsigned int opts = 0;
|
1545
1545
|
VALUE buf = Qnil;
|
1546
1546
|
VALUE hash = Qnil;
|
1547
1547
|
|
1548
|
-
VALUE html =
|
1549
|
-
VALUE failed_start =
|
1548
|
+
VALUE html = STR_NEW2("");
|
1549
|
+
VALUE failed_start = STR_NEW2("");
|
1550
1550
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
1551
1551
|
int stack[CALL_STACK_SIZE],top,nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
1552
1552
|
|
@@ -1830,7 +1830,7 @@ _eof_trans:
|
|
1830
1830
|
break;
|
1831
1831
|
case 44:
|
1832
1832
|
#line 80 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1833
|
-
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1833
|
+
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 647; goto _again;} }}
|
1834
1834
|
break;
|
1835
1835
|
case 45:
|
1836
1836
|
#line 81 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -1842,7 +1842,7 @@ _eof_trans:
|
|
1842
1842
|
break;
|
1843
1843
|
case 47:
|
1844
1844
|
#line 80 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1845
|
-
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1845
|
+
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 647; goto _again;} }}
|
1846
1846
|
break;
|
1847
1847
|
case 48:
|
1848
1848
|
#line 82 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -1850,7 +1850,7 @@ _eof_trans:
|
|
1850
1850
|
break;
|
1851
1851
|
case 49:
|
1852
1852
|
#line 80 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1853
|
-
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1853
|
+
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 647; goto _again;} }}
|
1854
1854
|
break;
|
1855
1855
|
case 50:
|
1856
1856
|
#line 82 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -1872,7 +1872,7 @@ _eof_trans:
|
|
1872
1872
|
break;
|
1873
1873
|
case 53:
|
1874
1874
|
#line 40 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1875
|
-
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
1875
|
+
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 663; goto _again;} }}
|
1876
1876
|
break;
|
1877
1877
|
case 54:
|
1878
1878
|
#line 32 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -1918,7 +1918,7 @@ _eof_trans:
|
|
1918
1918
|
break;
|
1919
1919
|
case 60:
|
1920
1920
|
#line 59 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1921
|
-
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
1921
|
+
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 663; goto _again;} }}
|
1922
1922
|
break;
|
1923
1923
|
case 61:
|
1924
1924
|
#line 45 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -1969,7 +1969,7 @@ _eof_trans:
|
|
1969
1969
|
break;
|
1970
1970
|
case 67:
|
1971
1971
|
#line 77 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
1972
|
-
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
1972
|
+
{te = p+1;{ CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 663; goto _again;} }}
|
1973
1973
|
break;
|
1974
1974
|
case 68:
|
1975
1975
|
#line 64 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -2096,15 +2096,15 @@ _eof_trans:
|
|
2096
2096
|
break;
|
2097
2097
|
case 87:
|
2098
2098
|
#line 120 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
2099
|
-
{te = p+1;{ rb_str_append(failed_start,
|
2099
|
+
{te = p+1;{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 653; goto _again;} }}
|
2100
2100
|
break;
|
2101
2101
|
case 88:
|
2102
2102
|
#line 121 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
2103
|
-
{te = p+1;{ rb_str_append(failed_start,
|
2103
|
+
{te = p+1;{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; {cs = 656; goto _again;} }}
|
2104
2104
|
break;
|
2105
2105
|
case 89:
|
2106
2106
|
#line 122 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
2107
|
-
{te = p+1;{ rb_str_append(failed_start,
|
2107
|
+
{te = p+1;{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_title = 0; {cs = 660; goto _again;} }}
|
2108
2108
|
break;
|
2109
2109
|
case 90:
|
2110
2110
|
#line 124 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -2112,7 +2112,7 @@ _eof_trans:
|
|
2112
2112
|
break;
|
2113
2113
|
case 91:
|
2114
2114
|
#line 120 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
2115
|
-
{te = p;p--;{ rb_str_append(failed_start,
|
2115
|
+
{te = p;p--;{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 653; goto _again;} }}
|
2116
2116
|
break;
|
2117
2117
|
case 92:
|
2118
2118
|
#line 9 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -2124,7 +2124,7 @@ _eof_trans:
|
|
2124
2124
|
break;
|
2125
2125
|
case 94:
|
2126
2126
|
#line 120 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
2127
|
-
{{p = ((te))-1;}{ rb_str_append(failed_start,
|
2127
|
+
{{p = ((te))-1;}{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 653; goto _again;} }}
|
2128
2128
|
break;
|
2129
2129
|
case 95:
|
2130
2130
|
#line 9 "ext/redcloth_scan/redcloth_bbcode.c.rl"
|
@@ -25,14 +25,14 @@ redcloth_bbcode(self, p, pe, refs)
|
|
25
25
|
int cs, act, nest;
|
26
26
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
27
27
|
char *orig_p = p, *orig_pe = pe;
|
28
|
-
VALUE block =
|
28
|
+
VALUE block = STR_NEW2("");
|
29
29
|
VALUE regs = Qnil; CLEAR_REGS()
|
30
30
|
unsigned int opts = 0;
|
31
31
|
VALUE buf = Qnil;
|
32
32
|
VALUE hash = Qnil;
|
33
33
|
|
34
|
-
VALUE html =
|
35
|
-
VALUE failed_start =
|
34
|
+
VALUE html = STR_NEW2("");
|
35
|
+
VALUE failed_start = STR_NEW2("");
|
36
36
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
37
37
|
int stack[CALL_STACK_SIZE],top,nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
38
38
|
|
@@ -37,7 +37,7 @@
|
|
37
37
|
fgoto main;
|
38
38
|
};
|
39
39
|
default => cat;
|
40
|
-
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
40
|
+
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
41
41
|
*|;
|
42
42
|
|
43
43
|
bb_quote_tag := |*
|
@@ -56,7 +56,7 @@
|
|
56
56
|
else { CAT(block); }
|
57
57
|
};
|
58
58
|
default => cat;
|
59
|
-
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
59
|
+
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
60
60
|
*|;
|
61
61
|
|
62
62
|
bb_spoiler_tag := |*
|
@@ -74,7 +74,7 @@
|
|
74
74
|
else { CAT(block); }
|
75
75
|
};
|
76
76
|
default => cat;
|
77
|
-
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start =
|
77
|
+
EOF => { CLEAR(block); CLEAR_REGS(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
78
78
|
*|;
|
79
79
|
|
80
80
|
done := |*
|
@@ -117,9 +117,9 @@
|
|
117
117
|
# fhold;
|
118
118
|
# fcall bbcode_inline;
|
119
119
|
#};
|
120
|
-
bb_pre_tag_start => { rb_str_append(failed_start,
|
121
|
-
bb_quote_tag_start => { rb_str_append(failed_start,
|
122
|
-
bb_spoiler_tag_start => { rb_str_append(failed_start,
|
120
|
+
bb_pre_tag_start => { rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; fgoto bb_pre_tag; };
|
121
|
+
bb_quote_tag_start => { rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; fgoto bb_quote_tag; };
|
122
|
+
bb_spoiler_tag_start => { rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_title = 0; fgoto bb_spoiler_tag; };
|
123
123
|
blank_line => cat;
|
124
124
|
default => { fhold; fgoto block; };
|
125
125
|
*|;
|
@@ -1255,14 +1255,14 @@ redcloth_bbcode_inline(self, p, pe, refs)
|
|
1255
1255
|
int cs, act, nest;
|
1256
1256
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
1257
1257
|
char *orig_p = p, *orig_pe = pe;
|
1258
|
-
VALUE block =
|
1258
|
+
VALUE block = STR_NEW2("");
|
1259
1259
|
VALUE regs = Qnil; CLEAR_REGS()
|
1260
1260
|
unsigned int opts = 0;
|
1261
1261
|
VALUE buf = Qnil;
|
1262
1262
|
VALUE hash = Qnil;
|
1263
1263
|
|
1264
|
-
VALUE html =
|
1265
|
-
VALUE failed_start =
|
1264
|
+
VALUE html = STR_NEW2("");
|
1265
|
+
VALUE failed_start = STR_NEW2("");
|
1266
1266
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
1267
1267
|
int stack[CALL_STACK_SIZE],top,nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
1268
1268
|
|
@@ -1534,7 +1534,7 @@ _eof_trans:
|
|
1534
1534
|
break;
|
1535
1535
|
case 41:
|
1536
1536
|
#line 80 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
1537
|
-
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1537
|
+
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 518; goto _again;} }}
|
1538
1538
|
break;
|
1539
1539
|
case 42:
|
1540
1540
|
#line 81 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
@@ -1546,7 +1546,7 @@ _eof_trans:
|
|
1546
1546
|
break;
|
1547
1547
|
case 44:
|
1548
1548
|
#line 80 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
1549
|
-
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1549
|
+
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 518; goto _again;} }}
|
1550
1550
|
break;
|
1551
1551
|
case 45:
|
1552
1552
|
#line 82 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
@@ -1554,7 +1554,7 @@ _eof_trans:
|
|
1554
1554
|
break;
|
1555
1555
|
case 46:
|
1556
1556
|
#line 80 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
1557
|
-
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,
|
1557
|
+
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 518; goto _again;} }}
|
1558
1558
|
break;
|
1559
1559
|
case 47:
|
1560
1560
|
#line 82 "ext/redcloth_scan/redcloth_bbcode_inline.c.rl"
|
@@ -45,14 +45,14 @@ redcloth_bbcode_inline(self, p, pe, refs)
|
|
45
45
|
int cs, act, nest;
|
46
46
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
47
47
|
char *orig_p = p, *orig_pe = pe;
|
48
|
-
VALUE block =
|
48
|
+
VALUE block = STR_NEW2("");
|
49
49
|
VALUE regs = Qnil; CLEAR_REGS()
|
50
50
|
unsigned int opts = 0;
|
51
51
|
VALUE buf = Qnil;
|
52
52
|
VALUE hash = Qnil;
|
53
53
|
|
54
|
-
VALUE html =
|
55
|
-
VALUE failed_start =
|
54
|
+
VALUE html = STR_NEW2("");
|
55
|
+
VALUE failed_start = STR_NEW2("");
|
56
56
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
57
57
|
int stack[CALL_STACK_SIZE],top,nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
58
58
|
|
@@ -77,7 +77,7 @@
|
|
77
77
|
bb_img2 { UNLESS_DISABLED_INLINE(block,image,PASS(block, "name", "image");); };
|
78
78
|
bb_spoiler { PASS(block, "name", "bb_spoiler"); CLEAR_REGS();};
|
79
79
|
|
80
|
-
bb_pre_tag_start { ASET("type", "notextile"); rb_str_append(failed_start,
|
80
|
+
bb_pre_tag_start { ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); fgoto bb_inline_pre_tag; };
|
81
81
|
nl => { fhold; fret; };
|
82
82
|
default => { CAT(block); fret;};
|
83
83
|
*|;
|
@@ -11075,8 +11075,8 @@ red_pass(VALUE self, VALUE regs, VALUE ref, ID meth, VALUE refs)
|
|
11075
11075
|
VALUE
|
11076
11076
|
red_passthrough(VALUE self, char *ts, char *te, VALUE refs)
|
11077
11077
|
{
|
11078
|
-
VALUE ret =
|
11079
|
-
VALUE txt =
|
11078
|
+
VALUE ret = STR_NEW(ts,1);
|
11079
|
+
VALUE txt = STR_NEW(ts+1,te-ts-2);
|
11080
11080
|
|
11081
11081
|
if (!NIL_P(txt)) {
|
11082
11082
|
//printf("red_passthrough() '%s'\n", RSTRING(txt)->ptr);
|
@@ -11112,7 +11112,7 @@ red_pass_code(VALUE self, VALUE regs, VALUE ref, ID meth)
|
|
11112
11112
|
{
|
11113
11113
|
VALUE txt = rb_hash_aref(regs, ref);
|
11114
11114
|
if (!NIL_P(txt)) {
|
11115
|
-
VALUE txt2 =
|
11115
|
+
VALUE txt2 = STR_NEW2("");
|
11116
11116
|
rb_str_cat_escaped_for_preformatted(self, txt2, RSTRING_PTR(txt), RSTRING_PTR(txt) + RSTRING_LEN(txt));
|
11117
11117
|
rb_hash_aset(regs, ref, txt2);
|
11118
11118
|
}
|
@@ -11180,14 +11180,14 @@ redcloth_inline(self, p, pe, refs)
|
|
11180
11180
|
int cs, act;
|
11181
11181
|
char *ts, *te, *reg, *eof;
|
11182
11182
|
char *orig_p = p, *orig_pe = pe;
|
11183
|
-
VALUE block =
|
11183
|
+
VALUE block = STR_NEW2("");
|
11184
11184
|
VALUE regs = Qnil;
|
11185
11185
|
unsigned int opts = 0;
|
11186
11186
|
VALUE buf = Qnil;
|
11187
11187
|
VALUE hash = Qnil;
|
11188
11188
|
|
11189
|
-
VALUE html =
|
11190
|
-
VALUE failed_start =
|
11189
|
+
VALUE html = STR_NEW2("");
|
11190
|
+
VALUE failed_start = STR_NEW2("");
|
11191
11191
|
int stack[CALL_STACK_SIZE],top;
|
11192
11192
|
|
11193
11193
|
|
@@ -11573,7 +11573,7 @@ _eof_trans:
|
|
11573
11573
|
break;
|
11574
11574
|
case 58:
|
11575
11575
|
#line 80 "ext/redcloth_scan/redcloth_inline.c.rl"
|
11576
|
-
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
11576
|
+
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }}
|
11577
11577
|
break;
|
11578
11578
|
case 59:
|
11579
11579
|
#line 81 "ext/redcloth_scan/redcloth_inline.c.rl"
|
@@ -11585,7 +11585,7 @@ _eof_trans:
|
|
11585
11585
|
break;
|
11586
11586
|
case 61:
|
11587
11587
|
#line 80 "ext/redcloth_scan/redcloth_inline.c.rl"
|
11588
|
-
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
11588
|
+
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }}
|
11589
11589
|
break;
|
11590
11590
|
case 62:
|
11591
11591
|
#line 82 "ext/redcloth_scan/redcloth_inline.c.rl"
|
@@ -11593,7 +11593,7 @@ _eof_trans:
|
|
11593
11593
|
break;
|
11594
11594
|
case 63:
|
11595
11595
|
#line 80 "ext/redcloth_scan/redcloth_inline.c.rl"
|
11596
|
-
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,
|
11596
|
+
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }}
|
11597
11597
|
break;
|
11598
11598
|
case 64:
|
11599
11599
|
#line 82 "ext/redcloth_scan/redcloth_inline.c.rl"
|
@@ -12110,7 +12110,7 @@ rb_str_cat_escaped(self, str, ts, te)
|
|
12110
12110
|
VALUE self, str;
|
12111
12111
|
char *ts, *te;
|
12112
12112
|
{
|
12113
|
-
VALUE source_str =
|
12113
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
12114
12114
|
VALUE escaped_str = rb_funcall(self, rb_intern("escape"), 1, source_str);
|
12115
12115
|
rb_str_concat(str, escaped_str);
|
12116
12116
|
}
|
@@ -12120,7 +12120,7 @@ rb_str_cat_escaped_for_preformatted(self, str, ts, te)
|
|
12120
12120
|
VALUE self, str;
|
12121
12121
|
char *ts, *te;
|
12122
12122
|
{
|
12123
|
-
VALUE source_str =
|
12123
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
12124
12124
|
VALUE escaped_str = rb_funcall(self, rb_intern("escape_pre"), 1, source_str);
|
12125
12125
|
rb_str_concat(str, escaped_str);
|
12126
12126
|
}
|
@@ -12130,7 +12130,7 @@ rb_str_cat_escaped_test(self, str, ts, te)
|
|
12130
12130
|
VALUE self, str;
|
12131
12131
|
char *ts, *te;
|
12132
12132
|
{
|
12133
|
-
VALUE source_str =
|
12133
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
12134
12134
|
rb_str_concat(str, source_str);
|
12135
12135
|
}
|
12136
12136
|
|
@@ -40,8 +40,8 @@ red_pass(VALUE self, VALUE regs, VALUE ref, ID meth, VALUE refs)
|
|
40
40
|
VALUE
|
41
41
|
red_passthrough(VALUE self, char *ts, char *te, VALUE refs)
|
42
42
|
{
|
43
|
-
VALUE ret =
|
44
|
-
VALUE txt =
|
43
|
+
VALUE ret = STR_NEW(ts,1);
|
44
|
+
VALUE txt = STR_NEW(ts+1,te-ts-2);
|
45
45
|
|
46
46
|
if (!NIL_P(txt)) {
|
47
47
|
//printf("red_passthrough() '%s'\n", RSTRING(txt)->ptr);
|
@@ -77,7 +77,7 @@ red_pass_code(VALUE self, VALUE regs, VALUE ref, ID meth)
|
|
77
77
|
{
|
78
78
|
VALUE txt = rb_hash_aref(regs, ref);
|
79
79
|
if (!NIL_P(txt)) {
|
80
|
-
VALUE txt2 =
|
80
|
+
VALUE txt2 = STR_NEW2("");
|
81
81
|
rb_str_cat_escaped_for_preformatted(self, txt2, RSTRING_PTR(txt), RSTRING_PTR(txt) + RSTRING_LEN(txt));
|
82
82
|
rb_hash_aset(regs, ref, txt2);
|
83
83
|
}
|
@@ -145,14 +145,14 @@ redcloth_inline(self, p, pe, refs)
|
|
145
145
|
int cs, act;
|
146
146
|
char *ts, *te, *reg, *eof;
|
147
147
|
char *orig_p = p, *orig_pe = pe;
|
148
|
-
VALUE block =
|
148
|
+
VALUE block = STR_NEW2("");
|
149
149
|
VALUE regs = Qnil;
|
150
150
|
unsigned int opts = 0;
|
151
151
|
VALUE buf = Qnil;
|
152
152
|
VALUE hash = Qnil;
|
153
153
|
|
154
|
-
VALUE html =
|
155
|
-
VALUE failed_start =
|
154
|
+
VALUE html = STR_NEW2("");
|
155
|
+
VALUE failed_start = STR_NEW2("");
|
156
156
|
int stack[CALL_STACK_SIZE],top;
|
157
157
|
|
158
158
|
%% write init;
|
@@ -172,7 +172,7 @@ rb_str_cat_escaped(self, str, ts, te)
|
|
172
172
|
VALUE self, str;
|
173
173
|
char *ts, *te;
|
174
174
|
{
|
175
|
-
VALUE source_str =
|
175
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
176
176
|
VALUE escaped_str = rb_funcall(self, rb_intern("escape"), 1, source_str);
|
177
177
|
rb_str_concat(str, escaped_str);
|
178
178
|
}
|
@@ -182,7 +182,7 @@ rb_str_cat_escaped_for_preformatted(self, str, ts, te)
|
|
182
182
|
VALUE self, str;
|
183
183
|
char *ts, *te;
|
184
184
|
{
|
185
|
-
VALUE source_str =
|
185
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
186
186
|
VALUE escaped_str = rb_funcall(self, rb_intern("escape_pre"), 1, source_str);
|
187
187
|
rb_str_concat(str, escaped_str);
|
188
188
|
}
|
@@ -192,7 +192,7 @@ rb_str_cat_escaped_test(self, str, ts, te)
|
|
192
192
|
VALUE self, str;
|
193
193
|
char *ts, *te;
|
194
194
|
{
|
195
|
-
VALUE source_str =
|
195
|
+
VALUE source_str = STR_NEW(ts, te-ts);
|
196
196
|
rb_str_concat(str, source_str);
|
197
197
|
}
|
198
198
|
|
@@ -9302,9 +9302,9 @@ redcloth_transform(self, p, pe, refs)
|
|
9302
9302
|
char *orig_p = p, *orig_pe = pe;
|
9303
9303
|
int cs, act, nest;
|
9304
9304
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
9305
|
-
VALUE html =
|
9306
|
-
VALUE table =
|
9307
|
-
VALUE block =
|
9305
|
+
VALUE html = STR_NEW2("");
|
9306
|
+
VALUE table = STR_NEW2("");
|
9307
|
+
VALUE block = STR_NEW2("");
|
9308
9308
|
VALUE regs; CLEAR_REGS()
|
9309
9309
|
|
9310
9310
|
|
@@ -9317,7 +9317,7 @@ redcloth_transform(self, p, pe, refs)
|
|
9317
9317
|
char listm[10] = "";
|
9318
9318
|
VALUE refs_found = rb_hash_new();
|
9319
9319
|
|
9320
|
-
VALUE failed_start =
|
9320
|
+
VALUE failed_start = STR_NEW2("");
|
9321
9321
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
9322
9322
|
int nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
9323
9323
|
|
@@ -10010,7 +10010,7 @@ _eof_trans:
|
|
10010
10010
|
break;
|
10011
10011
|
case 112:
|
10012
10012
|
#line 265 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10013
|
-
{te = p+1;{ CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
10013
|
+
{te = p+1;{ CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 2517; goto _again;} }}
|
10014
10014
|
break;
|
10015
10015
|
case 113:
|
10016
10016
|
#line 256 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10060,7 +10060,7 @@ _eof_trans:
|
|
10060
10060
|
break;
|
10061
10061
|
case 119:
|
10062
10062
|
#line 287 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10063
|
-
{te = p+1;{ CLEAR(block); ADD_BLOCK(); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
10063
|
+
{te = p+1;{ CLEAR(block); ADD_BLOCK(); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 2517; goto _again;} }}
|
10064
10064
|
break;
|
10065
10065
|
case 120:
|
10066
10066
|
#line 269 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10123,7 +10123,7 @@ _eof_trans:
|
|
10123
10123
|
break;
|
10124
10124
|
case 128:
|
10125
10125
|
#line 306 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10126
|
-
{te = p+1;{ CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
10126
|
+
{te = p+1;{ CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; {cs = 2517; goto _again;} }}
|
10127
10127
|
break;
|
10128
10128
|
case 129:
|
10129
10129
|
#line 292 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10423,7 +10423,7 @@ _eof_trans:
|
|
10423
10423
|
break;
|
10424
10424
|
case 179:
|
10425
10425
|
#line 389 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10426
|
-
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
10426
|
+
{te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 2487; goto _again;} }}
|
10427
10427
|
break;
|
10428
10428
|
case 180:
|
10429
10429
|
#line 394 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10460,11 +10460,11 @@ _eof_trans:
|
|
10460
10460
|
break;
|
10461
10461
|
case 187:
|
10462
10462
|
#line 389 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10463
|
-
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,
|
10463
|
+
{te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 2487; goto _again;} }}
|
10464
10464
|
break;
|
10465
10465
|
case 188:
|
10466
10466
|
#line 390 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10467
|
-
{te = p;p--;{ rb_str_append(failed_start,
|
10467
|
+
{te = p;p--;{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; {cs = 2490; goto _again;} }}
|
10468
10468
|
break;
|
10469
10469
|
case 189:
|
10470
10470
|
#line 393 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10553,11 +10553,11 @@ _eof_trans:
|
|
10553
10553
|
break;
|
10554
10554
|
case 209:
|
10555
10555
|
#line 389 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10556
|
-
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,
|
10556
|
+
{{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 2487; goto _again;} }}
|
10557
10557
|
break;
|
10558
10558
|
case 210:
|
10559
10559
|
#line 390 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10560
|
-
{{p = ((te))-1;}{ rb_str_append(failed_start,
|
10560
|
+
{{p = ((te))-1;}{ rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; {cs = 2490; goto _again;} }}
|
10561
10561
|
break;
|
10562
10562
|
case 211:
|
10563
10563
|
#line 397 "ext/redcloth_scan/redcloth_scan.c.rl"
|
@@ -10584,13 +10584,13 @@ _eof_trans:
|
|
10584
10584
|
#line 1 "ext/redcloth_scan/redcloth_scan.c.rl"
|
10585
10585
|
{ switch( act ) {
|
10586
10586
|
case 58:
|
10587
|
-
{{p = ((te))-1;} ASET("type", "notextile"); rb_str_append(failed_start,
|
10587
|
+
{{p = ((te))-1;} ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; {cs = 2487; goto _again;} }
|
10588
10588
|
break;
|
10589
10589
|
case 59:
|
10590
|
-
{{p = ((te))-1;} rb_str_append(failed_start,
|
10590
|
+
{{p = ((te))-1;} rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; {cs = 2490; goto _again;} }
|
10591
10591
|
break;
|
10592
10592
|
case 60:
|
10593
|
-
{{p = ((te))-1;} rb_str_append(failed_start,
|
10593
|
+
{{p = ((te))-1;} rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_title = 0; {cs = 2495; goto _again;} }
|
10594
10594
|
break;
|
10595
10595
|
case 61:
|
10596
10596
|
{{p = ((te))-1;} UNLESS_DISABLED_BLOCK(block,noparagraph_line_start,ASET("type", "ignored_line"); {cs = 2468; goto _again;}) }
|
@@ -10700,7 +10700,7 @@ redcloth_html_esc(int argc, VALUE* argv, VALUE self) //(self, str, level)
|
|
10700
10700
|
|
10701
10701
|
rb_scan_args(argc, argv, "11", &str, &level);
|
10702
10702
|
|
10703
|
-
VALUE new_str =
|
10703
|
+
VALUE new_str = STR_NEW2("");
|
10704
10704
|
if (str == Qnil)
|
10705
10705
|
return new_str;
|
10706
10706
|
|
@@ -10758,7 +10758,7 @@ redcloth_html_esc(int argc, VALUE* argv, VALUE self) //(self, str, level)
|
|
10758
10758
|
static VALUE
|
10759
10759
|
redcloth_latex_esc(VALUE self, VALUE str)
|
10760
10760
|
{
|
10761
|
-
VALUE new_str =
|
10761
|
+
VALUE new_str = STR_NEW2("");
|
10762
10762
|
|
10763
10763
|
if (str == Qnil)
|
10764
10764
|
return new_str;
|
@@ -10797,7 +10797,7 @@ redcloth_latex_esc(VALUE self, VALUE str)
|
|
10797
10797
|
if (t2 > t)
|
10798
10798
|
rb_str_cat(new_str, t, t2-t);
|
10799
10799
|
VALUE opts = rb_hash_new();
|
10800
|
-
rb_hash_aset(opts, ID2SYM(rb_intern("text")),
|
10800
|
+
rb_hash_aset(opts, ID2SYM(rb_intern("text")), STR_NEW2(ch));
|
10801
10801
|
rb_str_concat(new_str, rb_funcall(self, rb_intern("entity"), 1, opts));
|
10802
10802
|
t = t2 + 1;
|
10803
10803
|
}
|
@@ -10820,7 +10820,7 @@ redcloth_to(self, formatter)
|
|
10820
10820
|
char *pe, *p;
|
10821
10821
|
int len = 0;
|
10822
10822
|
|
10823
|
-
rb_funcall(self, rb_intern("delete!"), 1,
|
10823
|
+
rb_funcall(self, rb_intern("delete!"), 1, STR_NEW2("\r"));
|
10824
10824
|
VALUE working_copy = rb_obj_clone(self);
|
10825
10825
|
rb_extend_object(working_copy, formatter);
|
10826
10826
|
if (rb_funcall(working_copy, rb_intern("bbcode_only"), 0) == Qtrue) {
|
@@ -33,9 +33,9 @@ redcloth_transform(self, p, pe, refs)
|
|
33
33
|
char *orig_p = p, *orig_pe = pe;
|
34
34
|
int cs, act, nest;
|
35
35
|
char *ts = NULL, *te = NULL, *reg = NULL, *bck = NULL, *eof = NULL;
|
36
|
-
VALUE html =
|
37
|
-
VALUE table =
|
38
|
-
VALUE block =
|
36
|
+
VALUE html = STR_NEW2("");
|
37
|
+
VALUE table = STR_NEW2("");
|
38
|
+
VALUE block = STR_NEW2("");
|
39
39
|
VALUE regs; CLEAR_REGS()
|
40
40
|
|
41
41
|
|
@@ -48,7 +48,7 @@ redcloth_transform(self, p, pe, refs)
|
|
48
48
|
char listm[10] = "";
|
49
49
|
VALUE refs_found = rb_hash_new();
|
50
50
|
|
51
|
-
VALUE failed_start =
|
51
|
+
VALUE failed_start = STR_NEW2("");
|
52
52
|
char *failed_start_point_p = NULL, *failed_start_point_ts = NULL, *failed_start_point_te = NULL;
|
53
53
|
int nested_quote = 0, nested_spoiler = 0, store_cite = 1, store_title = 1;
|
54
54
|
|
@@ -88,7 +88,7 @@ redcloth_html_esc(int argc, VALUE* argv, VALUE self) //(self, str, level)
|
|
88
88
|
|
89
89
|
rb_scan_args(argc, argv, "11", &str, &level);
|
90
90
|
|
91
|
-
VALUE new_str =
|
91
|
+
VALUE new_str = STR_NEW2("");
|
92
92
|
if (str == Qnil)
|
93
93
|
return new_str;
|
94
94
|
|
@@ -146,7 +146,7 @@ redcloth_html_esc(int argc, VALUE* argv, VALUE self) //(self, str, level)
|
|
146
146
|
static VALUE
|
147
147
|
redcloth_latex_esc(VALUE self, VALUE str)
|
148
148
|
{
|
149
|
-
VALUE new_str =
|
149
|
+
VALUE new_str = STR_NEW2("");
|
150
150
|
|
151
151
|
if (str == Qnil)
|
152
152
|
return new_str;
|
@@ -185,7 +185,7 @@ redcloth_latex_esc(VALUE self, VALUE str)
|
|
185
185
|
if (t2 > t)
|
186
186
|
rb_str_cat(new_str, t, t2-t);
|
187
187
|
VALUE opts = rb_hash_new();
|
188
|
-
rb_hash_aset(opts, ID2SYM(rb_intern("text")),
|
188
|
+
rb_hash_aset(opts, ID2SYM(rb_intern("text")), STR_NEW2(ch));
|
189
189
|
rb_str_concat(new_str, rb_funcall(self, rb_intern("entity"), 1, opts));
|
190
190
|
t = t2 + 1;
|
191
191
|
}
|
@@ -208,7 +208,7 @@ redcloth_to(self, formatter)
|
|
208
208
|
char *pe, *p;
|
209
209
|
int len = 0;
|
210
210
|
|
211
|
-
rb_funcall(self, rb_intern("delete!"), 1,
|
211
|
+
rb_funcall(self, rb_intern("delete!"), 1, STR_NEW2("\r"));
|
212
212
|
VALUE working_copy = rb_obj_clone(self);
|
213
213
|
rb_extend_object(working_copy, formatter);
|
214
214
|
if (rb_funcall(working_copy, rb_intern("bbcode_only"), 0) == Qtrue) {
|
@@ -262,7 +262,7 @@
|
|
262
262
|
fgoto main;
|
263
263
|
};
|
264
264
|
default => cat;
|
265
|
-
EOF => { CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
265
|
+
EOF => { CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
266
266
|
*|;
|
267
267
|
|
268
268
|
bb_quote_tag := |*
|
@@ -284,7 +284,7 @@
|
|
284
284
|
else { CAT(block); }
|
285
285
|
};
|
286
286
|
default => cat;
|
287
|
-
EOF => { CLEAR(block); ADD_BLOCK(); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
287
|
+
EOF => { CLEAR(block); ADD_BLOCK(); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
288
288
|
*|;
|
289
289
|
|
290
290
|
bb_spoiler_tag := |*
|
@@ -303,7 +303,7 @@
|
|
303
303
|
else { CAT(block); }
|
304
304
|
};
|
305
305
|
default => cat;
|
306
|
-
EOF => { CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start =
|
306
|
+
EOF => { CLEAR(block); CLEAR_REGS(); RESET_TYPE(); rb_str_append(block,failed_start); failed_start = STR_NEW2(""); p = failed_start_point_p; ts = failed_start_point_ts; te = failed_start_point_te; fgoto done; };
|
307
307
|
*|;
|
308
308
|
|
309
309
|
block := |*
|
@@ -386,9 +386,9 @@
|
|
386
386
|
*|;
|
387
387
|
|
388
388
|
main := |*
|
389
|
-
bb_pre_tag_start { ASET("type", "notextile"); rb_str_append(failed_start,
|
390
|
-
bb_quote_tag_start { rb_str_append(failed_start,
|
391
|
-
bb_spoiler_tag_start { rb_str_append(failed_start,
|
389
|
+
bb_pre_tag_start { ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; fgoto bb_pre_tag; };
|
390
|
+
bb_quote_tag_start { rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_cite = 0; fgoto bb_quote_tag; };
|
391
|
+
bb_spoiler_tag_start { rb_str_append(failed_start,STR_NEW(ts,te-ts)); failed_start_point_p = p; failed_start_point_ts = ts; failed_start_point_te = te; store_title = 0; fgoto bb_spoiler_tag; };
|
392
392
|
|
393
393
|
noparagraph_line_start { UNLESS_DISABLED_BLOCK(block,noparagraph_line_start,ASET("type", "ignored_line"); fgoto noparagraph_line;) };
|
394
394
|
notextile_tag_start { ASET("type", "notextile"); fgoto notextile_tag; };
|
data/lib/redcloth/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -93,17 +93,17 @@ EOT
|
|
93
93
|
end
|
94
94
|
|
95
95
|
|
96
|
-
module ShowColorCodes
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
107
|
-
Test::Unit::Assertions::AssertionMessage::Template.send(:include, ShowColorCodes)
|
96
|
+
#module ShowColorCodes
|
97
|
+
# def self.included(base)
|
98
|
+
# base.class_eval do
|
99
|
+
# alias_method :result_without_color_codes, :result unless method_defined?(:result_without_color_codes)
|
100
|
+
# alias_method :result, :result_with_color_codes
|
101
|
+
# end
|
102
|
+
# end
|
103
|
+
# def result_with_color_codes(parameters)
|
104
|
+
# result_without_color_codes(parameters.collect {|p| p.gsub(/\\e\[(\d+)m/) {"\e[#{$1}m"} })
|
105
|
+
# end
|
106
|
+
#end
|
107
|
+
#Test::Unit::Assertions::AssertionMessage::Template.send(:include, ShowColorCodes)
|
108
108
|
rescue LoadError
|
109
109
|
end
|
data/test/test_custom_tags.rb
CHANGED
data/test/test_erb.rb
CHANGED
data/test/test_extensions.rb
CHANGED
data/test/test_formatters.rb
CHANGED
data/test/test_parser.rb
CHANGED
data/test/test_restrictions.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: BBRedCloth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 8
|
9
|
-
- 4
|
10
|
-
version: 0.8.4
|
4
|
+
prerelease:
|
5
|
+
version: 0.8.5
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Ryan Alyea
|
@@ -15,12 +10,11 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
13
|
+
date: 2011-09-02 00:00:00 Z
|
20
14
|
dependencies: []
|
21
15
|
|
22
16
|
description: |-
|
23
|
-
BBRedCloth-0.8.
|
17
|
+
BBRedCloth-0.8.5 - Textile parser for Ruby. Includes BBCode additions.
|
24
18
|
http://redcloth.org/
|
25
19
|
email: ryan@fangamer.com
|
26
20
|
executables:
|
@@ -105,7 +99,6 @@ files:
|
|
105
99
|
- ext/redcloth_scan/redcloth_scan.c
|
106
100
|
- ext/redcloth_scan/redcloth_bbcode.c
|
107
101
|
- ext/redcloth_scan/redcloth_bbcode_inline.c
|
108
|
-
has_rdoc: true
|
109
102
|
homepage: http://redcloth.org
|
110
103
|
licenses: []
|
111
104
|
|
@@ -126,29 +119,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
119
|
requirements:
|
127
120
|
- - ">="
|
128
121
|
- !ruby/object:Gem::Version
|
129
|
-
hash: 63
|
130
|
-
segments:
|
131
|
-
- 1
|
132
|
-
- 8
|
133
|
-
- 4
|
134
122
|
version: 1.8.4
|
135
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
124
|
none: false
|
137
125
|
requirements:
|
138
126
|
- - ">="
|
139
127
|
- !ruby/object:Gem::Version
|
140
|
-
hash: 11
|
141
|
-
segments:
|
142
|
-
- 1
|
143
|
-
- 2
|
144
128
|
version: "1.2"
|
145
129
|
requirements: []
|
146
130
|
|
147
131
|
rubyforge_project: bbredcloth
|
148
|
-
rubygems_version: 1.
|
132
|
+
rubygems_version: 1.8.7
|
149
133
|
signing_key:
|
150
134
|
specification_version: 3
|
151
|
-
summary: BBRedCloth-0.8.
|
135
|
+
summary: BBRedCloth-0.8.5 - Textile parser for Ruby. Includes BBCode additions. http://redcloth.org/
|
152
136
|
test_files:
|
153
137
|
- test/test_custom_tags.rb
|
154
138
|
- test/test_erb.rb
|