Skip to content
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

Chain our debug setting through to CSS Parser's leniency setting #1139

Open
JakeQZ opened this issue Dec 17, 2021 · 0 comments
Open

Chain our debug setting through to CSS Parser's leniency setting #1139

JakeQZ opened this issue Dec 17, 2021 · 0 comments

Comments

@JakeQZ
Copy link
Contributor

JakeQZ commented Dec 17, 2021

See MyIntervals/PHP-CSS-Parser#346.

We just need to pass on CssInliner::$debug through Pelago\Emogrifier\Css\CssDocument to Sabberworm\CSS\Parser, mostly with one line of code to be added:

$parserSettings = \Sabberworm\CSS\Settings::create()->withLenientParsing(!$debug);

This will resolve one of the failing tests in #1129.

But life is never simple. Simply applying the requried code change leads to a whole bunch of additional test failures, which need to be looked into. On initial glance, quite a few are because we expect an exception for malformed CSS but would now be getting a different class of exception. But there are other failures of a different nature too.

@JakeQZ JakeQZ self-assigned this Dec 17, 2021
@JakeQZ JakeQZ added this to the 7.0.0 milestone Dec 17, 2021
JakeQZ added a commit that referenced this issue Dec 20, 2021
This is for tests where the CSS is not meant to be deliberately invalid.

(Found while working on #1139.)
oliverklee pushed a commit that referenced this issue Dec 20, 2021
This is for tests where the CSS is not meant to be deliberately invalid.

(Found while working on #1139.)
JakeQZ added a commit that referenced this issue Dec 21, 2021
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.
JakeQZ added a commit that referenced this issue Jan 12, 2022
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.
oliverklee pushed a commit that referenced this issue Jan 12, 2022
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.
@oliverklee oliverklee modified the milestones: 7.0.0, 8.0.0 Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants