minihtml 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/ext/minihtml_scanner/minihtml_scanner.c +11 -3
- data/ext/minihtml_scanner/minihtml_scanner.h +1 -1
- data/lib/minihtml/parser.rb +1 -1
- data/lib/minihtml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d90a28350da95008be85c99ce550b4d12639ab4f4976118399f4c38ac805caf
|
4
|
+
data.tar.gz: 537eb44bc01696dcc6dc7021dbb0a195c4b345ac2c664639a2ec7df63707c706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8183a4e0de66c425138fab1726aa1c8f79fc9718373eab03c77325f83458d2575a6635fb23c6c5e390f7f1492eafd8ebefa3d1a95b935477c243e188c2c9a77f
|
7
|
+
data.tar.gz: 4e99ac58f94d4c7cc50c483139d726ce1dd488110d826eebefd173a23d79bcc3e81bf46e681976b5ddf5964873c6b9959e5203390fd5dbca6d712a8b57f697df
|
@@ -294,6 +294,15 @@ static void scanner_consume_attr_name(scanner_t *t) {
|
|
294
294
|
}
|
295
295
|
}
|
296
296
|
|
297
|
+
static void scanner_consume_unquoted_attr_value(scanner_t *t) {
|
298
|
+
bool consumed = false;
|
299
|
+
while (t->look[0] != EOF && !scanner_is_space(t->look[0]) && t->look[0] != SOLIDUS && t->look[0] != ANGLED_RIGHT) {
|
300
|
+
scanner_consume(t);
|
301
|
+
consumed = true;
|
302
|
+
}
|
303
|
+
if (consumed) scanner_push_token_simple(t, sym_attr_value_unquoted);
|
304
|
+
}
|
305
|
+
|
297
306
|
static void scanner_consume_attr(scanner_t *t) {
|
298
307
|
scanner_start_token(t);
|
299
308
|
scanner_consume_attr_name(t);
|
@@ -316,8 +325,7 @@ static void scanner_consume_attr(scanner_t *t) {
|
|
316
325
|
}
|
317
326
|
default:
|
318
327
|
scanner_start_token(t);
|
319
|
-
|
320
|
-
scanner_push_token_simple(t, sym_attr_value_literal);
|
328
|
+
scanner_consume_unquoted_attr_value(t);
|
321
329
|
break;
|
322
330
|
}
|
323
331
|
}
|
@@ -529,7 +537,6 @@ RUBY_FUNC_EXPORTED void Init_minihtml_scanner(void) {
|
|
529
537
|
INITIALIZE_REUSABLE_SYMBOL(tag_closing_end);
|
530
538
|
INITIALIZE_REUSABLE_SYMBOL(right_angled);
|
531
539
|
INITIALIZE_REUSABLE_SYMBOL(attr_key);
|
532
|
-
INITIALIZE_REUSABLE_SYMBOL(attr_value_literal);
|
533
540
|
INITIALIZE_REUSABLE_SYMBOL(kind);
|
534
541
|
INITIALIZE_REUSABLE_SYMBOL(string);
|
535
542
|
INITIALIZE_REUSABLE_SYMBOL(string_interpolation);
|
@@ -538,6 +545,7 @@ RUBY_FUNC_EXPORTED void Init_minihtml_scanner(void) {
|
|
538
545
|
INITIALIZE_REUSABLE_SYMBOL(equal);
|
539
546
|
INITIALIZE_REUSABLE_SYMBOL(quote_char);
|
540
547
|
INITIALIZE_REUSABLE_SYMBOL(tag_comment_end);
|
548
|
+
INITIALIZE_REUSABLE_SYMBOL(attr_value_unquoted);
|
541
549
|
|
542
550
|
rb_define_alloc_func(rb_cScanner, scanner_alloc);
|
543
551
|
rb_define_method(rb_cScanner, "initialize", scanner_initialize, 1);
|
@@ -45,7 +45,6 @@ DEFINE_REUSABLE_SYMBOL(tag_closing_start);
|
|
45
45
|
DEFINE_REUSABLE_SYMBOL(tag_closing_end);
|
46
46
|
DEFINE_REUSABLE_SYMBOL(right_angled);
|
47
47
|
DEFINE_REUSABLE_SYMBOL(attr_key);
|
48
|
-
DEFINE_REUSABLE_SYMBOL(attr_value_literal);
|
49
48
|
DEFINE_REUSABLE_SYMBOL(kind);
|
50
49
|
DEFINE_REUSABLE_SYMBOL(string);
|
51
50
|
DEFINE_REUSABLE_SYMBOL(string_interpolation);
|
@@ -54,6 +53,7 @@ DEFINE_REUSABLE_SYMBOL(executable);
|
|
54
53
|
DEFINE_REUSABLE_SYMBOL(equal);
|
55
54
|
DEFINE_REUSABLE_SYMBOL(quote_char);
|
56
55
|
DEFINE_REUSABLE_SYMBOL(tag_comment_end);
|
56
|
+
DEFINE_REUSABLE_SYMBOL(attr_value_unquoted);
|
57
57
|
|
58
58
|
typedef struct {
|
59
59
|
VALUE str;
|
data/lib/minihtml/parser.rb
CHANGED
data/lib/minihtml/version.rb
CHANGED