Changeset 135

Show
Ignore:
Timestamp:
01/22/2007 02:00:27 (22 months ago)
Author:
why
Message:
  • lib/superredcloth.rb: let's not escape from Ruby. that's so slow!
  • ext/superredcloth_scan/superredcloth_scan.rl: don't escape for now, i'll add a C function soon.
Location:
branches/superredcloth
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/superredcloth/ext/superredcloth_scan/superredcloth_scan.rl

    r134 r135  
    4343  action A { reg = p; } 
    4444  action X { regs = rb_hash_new(); reg = NULL; } 
    45   action cat { rb_str_append(block, rb_funcall(super_RedCloth, rb_intern("escape"), 1, rb_str_new(tokstart, tokend-tokstart))); } 
     45  action cat { rb_str_cat(block, tokstart, tokend-tokstart); } 
    4646 
    4747  # minor character groups 
  • branches/superredcloth/lib/superredcloth.rb

    r134 r135  
    7575    txt.gsub(/&/, '&') 
    7676  end 
    77   def escape txt 
    78     txt.gsub(/&/, '&amp;').gsub(/'/, "&#8217;").gsub(/</, '&lt;').gsub(/>/, '&gt;').gsub(/"/, '&quot;') 
    79   end 
    8077end