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

Support > :first-child and > :last-child #384

Closed
ghost opened this issue May 18, 2017 · 2 comments · Fixed by #720
Closed

Support > :first-child and > :last-child #384

ghost opened this issue May 18, 2017 · 2 comments · Fixed by #720

Comments

@ghost
Copy link

ghost commented May 18, 2017

The following selectors seem to generate invalid XPath, crashing the whole parser:

With :first-child:

  .an-element > :first-child {
    /** Any rules **/
  }

With :last-child:

  .an-element > :last-child {
    /** Any rules **/
  }

The issue is closely related for these two. It causes an InvalidArgumentException to be thrown (at https://github.com/jjriv/emogrifier/blob/master/Classes/Emogrifier.php#L1532)

@joeworkman
Copy link

:not(.class) selectors also trigger this error.

@oliverklee oliverklee changed the title > :first-child and > :last-child generate erroneous XPath Support > :first-child and > :last-child Jun 10, 2017
@oliverklee oliverklee modified the milestones: 2.1.0, 3.0.0 Jan 7, 2018
@oliverklee
Copy link
Contributor

@joeworkman I've entered #469 for adding support for :not(.class).

@JakeQZ JakeQZ self-assigned this Sep 25, 2019
JakeQZ added a commit that referenced this issue Sep 25, 2019
Also added tests for `:first-child` and `:last-child` as entire selector, which
previously had a placeholder comment “broken: …”.

Closes #384.
oliverklee pushed a commit that referenced this issue Sep 25, 2019
Also added tests for `:first-child` and `:last-child` as entire selector, which
previously had a placeholder comment “broken: …”.

Closes #384.
This issue was closed.
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