-
Notifications
You must be signed in to change notification settings - Fork 144
Support for @supports syntax #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems to be working for me. Can you provide a more elaborated example? |
@raxbg Maybe you’re parsing in lenient mode? |
Yes, I will probably work on this some time soon because I will need it 😄 |
Hm, I was just about to start working on this, but yet again I cannot reproduce it even without lenient mode. @bmbrands can you provide an example CSS which triggers this error? @sabberworm In my tests both
|
Yep, I find the issue is in strict mode only. In lenient mode, E.g. with the current code base the following test added to /**
* @test
*
* @param string $css
*
* @dataProvider mediaRuleDataProvider
*/
public function parsesMediaRuleInStrictMode($css)
{
(new Parser($css, Settings::create()->beStrict()))->parse();
self::assertTrue(true); // no exception was thrown
} The failure is:
Perhaps it is simply that the final closing See also #75. Note that |
This partially addresses both #1139 and #1140. However, if the CSS contains nested at-rules, the debug setting won't currently be passed on, due to MyIntervals/PHP-CSS-Parser#127. Some tests have been adapted to cater for an exception in debug mode with only some of the data.
This partially addresses both #1139 and #1140. However, if the CSS contains nested at-rules, the debug setting won't currently be passed on, due to MyIntervals/PHP-CSS-Parser#127. Some tests have been adapted to cater for an exception in debug mode with only some of the data.
This partially addresses both #1139 and #1140. However, if the CSS contains nested at-rules, the debug setting won't currently be passed on, due to MyIntervals/PHP-CSS-Parser#127. Some tests have been adapted to cater for an exception in debug mode with only some of the data.
The @supports syntax used in Bootstrap 4 is not supported.
When trying to compile it an exception is thrown:
Stack trace:
line 113 of /lib/php-css-parser/Parser.php: Sabberworm\CSS\Parsing\SourceException thrown
line 197 of /lib/php-css-parser/Parser.php: call to Sabberworm\CSS\Parser->parseList()
line 119 of /lib/php-css-parser/Parser.php: call to Sabberworm\CSS\Parser->parseAtRule()
line 96 of /lib/php-css-parser/Parser.php: call to Sabberworm\CSS\Parser->parseListItem()
line 87 of /lib/php-css-parser/Parser.php: call to Sabberworm\CSS\Parser->parseList()
line 82 of /lib/php-css-parser/Parser.php: call to Sabberworm\CSS\Parser->parseDocument()
line 61 of /testcss.php: call to Sabberworm\CSS\Parser->parse()
Exception - Unexpected end of document [line no: 23]
The text was updated successfully, but these errors were encountered: