Giter Site home page Giter Site logo

Comments (5)

conradz avatar conradz commented on July 30, 2024

This seems to have been fixed in the latest version of css. Please re-open if it still occurs in the latest version 2.2.1. If you're running an older version you can expect that there will be bugs that have been fixed.

from css.

pocketjoso avatar pocketjoso commented on July 30, 2024

@conradz Did you actually test that it works inside phantomjs with [email protected]? As I mentioned I had issues using that version inside phantomjs last time I tried, but will try again now.

from css.

pocketjoso avatar pocketjoso commented on July 30, 2024

So @conradz I tested this myself now in [email protected] (I had to manually revert this commit, as it doesn't work in phantomjs) - and it doesn't work in this version either, in phantomjs.

with this test css:
.breakingDeclaration{filter:unquote("()")}html{color:red;}div{color:blue;}

outside phantomjs -- correct

css.parse outside of phantomjs produces an ast with rules.length 3:

.breakingDeclaration
property: filter
value: unquote("()")

html
property: color
value: red

div
property: color
value: blue

inside phantomjs -- incorrect

whereas inside phantomjseverything gets incorrectly collapsed into the broken declaration, ast rules.length 1:

.breakingDeclaration
property: filter
value: unquote("()")}html{color:red;}div{color:blue

Like I said from the beginning, I'm not sure if there's anything you can do about this form your libraries point of view. Just wanted to clarify that is doesn't get fixed by latest version.

Cheers

from css.

pocketjoso avatar pocketjoso commented on July 30, 2024

I just don't have enough understanding of what css.parse does that could yield a different result when run inside phantomjs. I might just rewrite my usage so I do the parsing outside of phantomjs, seralise the ast, and then pass it in.

from css.

conradz avatar conradz commented on July 30, 2024

OK, thanks for the clarification, I hadn't understood that it was specific to phantomjs. Yeah I would think that the best way would be to parse in Node, transferring the CSS source to Node instead of parsing in phantomjs. Most likely an issue with regex matching in phantomjs, although I couldn't guarantee that is the problem.

from css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.