adamh-hpricot 0.6.210 → 0.6.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/hpricot_scan/hpricot_css.c +2112 -2116
- data/ext/hpricot_scan/hpricot_scan.c +147 -132
- data/ext/hpricot_scan/hpricot_scan.rl +14 -1
- metadata +1 -1
@@ -153,6 +153,19 @@ void rb_yield_tokens(VALUE sym, VALUE tag, VALUE attr, VALUE raw, int taint)
|
|
153
153
|
rb_yield(ary);
|
154
154
|
}
|
155
155
|
|
156
|
+
/* rb_hash_lookup() is only in Ruby 1.8.7 */
|
157
|
+
static VALUE
|
158
|
+
our_rb_hash_lookup(VALUE hash, VALUE key)
|
159
|
+
{
|
160
|
+
VALUE val;
|
161
|
+
|
162
|
+
if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
|
163
|
+
return Qnil; /* without Hash#default */
|
164
|
+
}
|
165
|
+
|
166
|
+
return val;
|
167
|
+
}
|
168
|
+
|
156
169
|
static void
|
157
170
|
rb_hpricot_add(VALUE focus, VALUE ele)
|
158
171
|
{
|
@@ -321,7 +334,7 @@ rb_hpricot_token(hpricot_state *S, VALUE sym, VALUE tag, VALUE attr, char *raw,
|
|
321
334
|
|
322
335
|
if (TYPE(hee->EC) == T_HASH)
|
323
336
|
{
|
324
|
-
VALUE has =
|
337
|
+
VALUE has = our_rb_hash_lookup(hee->EC, INT2NUM(he->name));
|
325
338
|
if (has != Qnil) {
|
326
339
|
if (has == Qtrue) {
|
327
340
|
if (match == Qnil)
|