ext/redcloth_scan/redcloth_inline.c in BBRedCloth-0.8.4 vs ext/redcloth_scan/redcloth_inline.c in BBRedCloth-0.8.5

- old
+ new

@@ -11073,12 +11073,12 @@ } VALUE red_passthrough(VALUE self, char *ts, char *te, VALUE refs) { - VALUE ret = rb_str_new(ts,1); - VALUE txt = rb_str_new(ts+1,te-ts-2); + VALUE ret = STR_NEW(ts,1); + VALUE txt = STR_NEW(ts+1,te-ts-2); if (!NIL_P(txt)) { //printf("red_passthrough() '%s'\n", RSTRING(txt)->ptr); if (rb_funcall(self, rb_intern("bbcode_only"), 0) == Qtrue){ rb_str_append(ret,redcloth_bbcode_inline2(self, txt, refs)); @@ -11110,11 +11110,11 @@ VALUE red_pass_code(VALUE self, VALUE regs, VALUE ref, ID meth) { VALUE txt = rb_hash_aref(regs, ref); if (!NIL_P(txt)) { - VALUE txt2 = rb_str_new2(""); + VALUE txt2 = STR_NEW2(""); rb_str_cat_escaped_for_preformatted(self, txt2, RSTRING_PTR(txt), RSTRING_PTR(txt) + RSTRING_LEN(txt)); rb_hash_aset(regs, ref, txt2); } return rb_funcall(self, meth, 1, regs); } @@ -11178,18 +11178,18 @@ VALUE refs; { int cs, act; char *ts, *te, *reg, *eof; char *orig_p = p, *orig_pe = pe; - VALUE block = rb_str_new2(""); + VALUE block = STR_NEW2(""); VALUE regs = Qnil; unsigned int opts = 0; VALUE buf = Qnil; VALUE hash = Qnil; - VALUE html = rb_str_new2(""); - VALUE failed_start = rb_str_new2(""); + VALUE html = STR_NEW2(""); + VALUE failed_start = STR_NEW2(""); int stack[CALL_STACK_SIZE],top; #line 11195 "ext/redcloth_scan/redcloth_inline.c" { @@ -11571,11 +11571,11 @@ #line 78 "ext/redcloth_scan/redcloth_inline.c.rl" {te = p+1;{ PASS(block, "name", "bb_spoiler"); CLEAR_REGS();}} break; case 58: #line 80 "ext/redcloth_scan/redcloth_inline.c.rl" - {te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,rb_str_new(ts,te-ts)); {cs = 2986; goto _again;} }} + {te = p+1;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }} break; case 59: #line 81 "ext/redcloth_scan/redcloth_inline.c.rl" {te = p+1;{ p--; {cs = stack[--top]; goto _again;} }} break; @@ -11583,19 +11583,19 @@ #line 82 "ext/redcloth_scan/redcloth_inline.c.rl" {te = p+1;{ CAT(block); {cs = stack[--top]; goto _again;}}} break; case 61: #line 80 "ext/redcloth_scan/redcloth_inline.c.rl" - {te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,rb_str_new(ts,te-ts)); {cs = 2986; goto _again;} }} + {te = p;p--;{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }} break; case 62: #line 82 "ext/redcloth_scan/redcloth_inline.c.rl" {te = p;p--;{ CAT(block); {cs = stack[--top]; goto _again;}}} break; case 63: #line 80 "ext/redcloth_scan/redcloth_inline.c.rl" - {{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,rb_str_new(ts,te-ts)); {cs = 2986; goto _again;} }} + {{p = ((te))-1;}{ ASET("type", "notextile"); rb_str_append(failed_start,STR_NEW(ts,te-ts)); {cs = 2986; goto _again;} }} break; case 64: #line 82 "ext/redcloth_scan/redcloth_inline.c.rl" {{p = ((te))-1;}{ CAT(block); {cs = stack[--top]; goto _again;}}} break; @@ -12108,30 +12108,30 @@ void rb_str_cat_escaped(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); VALUE escaped_str = rb_funcall(self, rb_intern("escape"), 1, source_str); rb_str_concat(str, escaped_str); } void rb_str_cat_escaped_for_preformatted(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); VALUE escaped_str = rb_funcall(self, rb_intern("escape_pre"), 1, source_str); rb_str_concat(str, escaped_str); } void rb_str_cat_escaped_test(self, str, ts, te) VALUE self, str; char *ts, *te; { - VALUE source_str = rb_str_new(ts, te-ts); + VALUE source_str = STR_NEW(ts, te-ts); rb_str_concat(str, source_str); } VALUE redcloth_inline2(self, str, refs)