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

Allow CSS selectors with colons #333

Closed
rauwebieten opened this issue Sep 1, 2016 · 0 comments · Fixed by #704
Closed

Allow CSS selectors with colons #333

rauwebieten opened this issue Sep 1, 2016 · 0 comments · Fixed by #704
Assignees
Milestone

Comments

@rauwebieten
Copy link

Emogrify throws exceptions when colons are used in a CSS3 selector.
They are converted to an invalid xpath predicate.

Example:

$html = '
    <a href="https://example.com">example.com</a>
';

$css = '
    a[href^="https:"] {
        color: orange;
    }
';

$emogrifier = new \Pelago\Emogrifier();
$emogrifier->setCss($css);
$emogrifier->setHtml($html);

print $emogrifier->emogrify();

When just using a[href^="https"] (without the colon) there are no problems.

@oliverklee oliverklee added the bug label Sep 5, 2016
@oliverklee oliverklee added this to the 1.2.0 milestone Sep 5, 2016
@oliverklee oliverklee self-assigned this Jan 20, 2017
@oliverklee oliverklee modified the milestones: 1.3.0, 1.2.0 Mar 2, 2017
@oliverklee oliverklee modified the milestones: 2.0.0, 2.1.0 Jan 4, 2018
@oliverklee oliverklee changed the title CSS selectors with colons Allow CSS selectors with colons Apr 3, 2018
@oliverklee oliverklee modified the milestones: 2.1.0, 3.0.0 Apr 3, 2018
@oliverklee oliverklee removed their assignment Aug 31, 2019
@JakeQZ JakeQZ self-assigned this Sep 11, 2019
JakeQZ added a commit that referenced this issue Sep 11, 2019
These have been fixed by virtue of using the Symfony CssSelector component.  The
additional unit tests confirm this.

Also added a few related, previously-intended unit tests which had a placeholder
comment “broken: …”.

Closes #284, closes #333, and closes #550.
oliverklee pushed a commit that referenced this issue Sep 12, 2019
These have been fixed by virtue of using the Symfony CssSelector component.  The
additional unit tests confirm this.

Also added a few related, previously-intended unit tests which had a placeholder
comment “broken: …”.

Closes #284
Closes #333
Closes #550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants