ph-css: Invalid selector is causing unrecoverable error

Hi again Philip, it’s been a while!

I am having the following situation and I wonder if you could give any advice here. It’s possible that it’s not your parser’s responsibility but perhaps you could point to a way to work around this with your APIs.

So, one of the goals of our application when it comes to CSS parsing is to transform all the url()-s in it. We do so by using the CSSVisitor.visitCSSUrl() method.

However, when we have CSS like this:

body {
    background: url(../bg.png);
}
.#f { color: red; }

the parser fails unrecoverably on the .#f selector and so we’re unable to transform the URLs. We’re using v4.0.0 with CSS3 parser and .setBrowserCompliantMode(true) - which, as I imagined, shouldn’t have treated such error as unrecoverable - as browser doesn’t.

Sorry if my questions are noob - I am by no means a Java programmer. Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Locally things are working. Please check with the latest SNAPSHOT