Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
Index: ext/hpricot_scan/hpricot_scan.java.rl =================================================================== --- ext/hpricot_scan/hpricot_scan.java.rl (revision 161) +++ ext/hpricot_scan/hpricot_scan.java.rl (working copy) @@ -259,7 +259,11 @@ /* We've used up the entire buffer storing an already-parsed token * prefix that must be preserved. Likely caused by super-long attributes. * See ticket #13. */ - rb_raise(rb_eHpricotParseError, "ran out of buffer space on element <" + tag.toString() + ">, starting on line "+curline+"."); + buffer_size += BUFSIZE; + char[] new_buf = new char[buffer_size]; + System.arraycopy(buf, 0, new_buf, 0, buf.length); + buf = new_buf; + space = buffer_size - have; } if (port.respondsTo("read")) {
This paste will be private.
From the Design Piracy series on my blog: