p_css 0.1.6 → 0.1.7
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/README.md +2 -2
- data/lib/css/parser.rb +5 -6
- data/lib/css/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: 99fe89569a8cb686b5fa018e7403b55ba6603a46ccad4a8df4821135579b6ada
|
|
4
|
+
data.tar.gz: 8474073401ef004e365a6e294dcf35c92338ad6c4688168e999fccecac6a95e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c79fcc55da6b57149893332f9d491912f66d04d8a2f6d6ffef9f57fb30872ecf22b00b4184730088fbcc92639bf7d55204c075147b78174f2f5e48d057f9ba8
|
|
7
|
+
data.tar.gz: efb733700697de31e950e90b35f10597d22975c3e0ae64ed8575474c0da175bd80bed92c39eedd3a3154560a0b7a604c79eeb3cb0ccec3b785429d7705918346
|
data/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Or:
|
|
|
61
61
|
bundle add p_css
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
Ruby 3.
|
|
64
|
+
Ruby 3.3+ is required. The matcher works against any object that quacks like
|
|
65
65
|
a DOM element (`Nokogiri::XML::Element` works out of the box); Nokogiri is not
|
|
66
66
|
a hard dependency.
|
|
67
67
|
|
|
@@ -350,7 +350,7 @@ These are deliberate omissions; pull requests welcome:
|
|
|
350
350
|
|
|
351
351
|
## Compatibility
|
|
352
352
|
|
|
353
|
-
Ruby 3.
|
|
353
|
+
Ruby 3.3+. Tested on the current MRI. No mandatory runtime dependencies.
|
|
354
354
|
|
|
355
355
|
## License
|
|
356
356
|
|
data/lib/css/parser.rb
CHANGED
|
@@ -207,8 +207,11 @@ module CSS
|
|
|
207
207
|
AtRule.new(name:, prelude:, block:)
|
|
208
208
|
end
|
|
209
209
|
|
|
210
|
+
# On EOF or a stop token (`}` while nested), the rule is dropped per
|
|
211
|
+
# §5.4.3 — but already-consumed prelude tokens are NOT put back. Rewinding
|
|
212
|
+
# would leave the caller's cursor at the same starting token and loop
|
|
213
|
+
# forever on input like `style="hidden"` (no `:` and no `{`).
|
|
210
214
|
def consume_qualified_rule(nested:)
|
|
211
|
-
saved = @pos
|
|
212
215
|
prelude = []
|
|
213
216
|
|
|
214
217
|
loop do
|
|
@@ -216,13 +219,9 @@ module CSS
|
|
|
216
219
|
|
|
217
220
|
case t.type
|
|
218
221
|
when :eof
|
|
219
|
-
@pos = saved
|
|
220
222
|
return nil
|
|
221
223
|
when :rbrace
|
|
222
|
-
if nested
|
|
223
|
-
@pos = saved
|
|
224
|
-
return nil
|
|
225
|
-
end
|
|
224
|
+
return nil if nested
|
|
226
225
|
|
|
227
226
|
prelude << consume
|
|
228
227
|
when :semicolon
|
data/lib/css/version.rb
CHANGED