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

> :first-child, > :last-child, and multiple attributes selectors generate erroneous XPath #383

Closed
ghost opened this issue May 18, 2017 · 3 comments
Labels

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 **/
  }

Multiple attributes:

  * input[text*="anytext"][type="text"] {
    /** Any rules **/
  }

No regex seem to match any of these 3 cases, causing an InvalidArgumentException to be thrown (at https://github.com/jjriv/emogrifier/blob/master/Classes/Emogrifier.php#L1532)

@oliverklee oliverklee added the bug label May 18, 2017
@oliverklee oliverklee added this to the 1.4.0 milestone May 18, 2017
@oliverklee
Copy link
Contributor

@ma-boily Thanks for the detailed bug report! Could you please open separate tickets for each issue? (Tickets for multiple issues are really a pain to work with.) Thanks!

@ghost
Copy link
Author

ghost commented May 18, 2017

@oliverklee Thanks for the prompt reply. I've split the 3 problems in two separate issues (:first-child and :last-child seem to be going to need a very similar fix). The third one though, seems a lot trickier from my understanding (as it uses regex for matching and replacing, it'd need an alternate way to iterate on all selectors).

Opened issues: #384 and #385

@oliverklee
Copy link
Contributor

@ma-boily Thanks! ❤️

@oliverklee oliverklee removed this from the 2.1.0 milestone Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant