GithubHelp home page GithubHelp logo

Infinite loop about dropcss HOT 7 CLOSED

leeoniya avatar leeoniya commented on May 23, 2024
Infinite loop

from dropcss.

Comments (7)

leeoniya avatar leeoniya commented on May 23, 2024

sounds like either the html or css parser. it would be great to narrow down the specific part that does this. i would try chopping away all the html and see if it still hangs, then it's the css. and vice versa. then start chopping 50% of the problem html or css in a way that keeps it well-formed. you should eventually find where this happens and report it here.

you might get faster feedback by running your html and css through linters or validators and see if they find any parsing issues.

ultimately i want to bail out of the tokenizing loops if a single iteration does not advance any further and spit out the position and some before/after context of where it got stuck. i'm currently on vacation, but will try to get this implemented in the next 2 weeks (maybe a devmode build?)

from dropcss.

leeoniya avatar leeoniya commented on May 23, 2024

Don't want to paste in everything here

you can attach "everything" here in a zip if it's not sensitive and i can look at it, too.

from dropcss.

heygrady avatar heygrady commented on May 23, 2024

Here's an example:
https://repl.it/@heygrady/dropcss-example

from dropcss.

leeoniya avatar leeoniya commented on May 23, 2024

should be fixed now. it was the lowly <br/>. the html parser was expecting whitespace to exist between the tagname and the trailing >.

from dropcss.

heygrady avatar heygrady commented on May 23, 2024

Is it still possible than an infinite loop will creep in? I can't use this in production if it enters infinite loops instead of erroring.

from dropcss.

leeoniya avatar leeoniya commented on May 23, 2024

for now, yes.

though with every additional set of unique html/css processed the probability drops significantly. the checks in the loops should be rather simple to add, and you're welcome to contribute them sooner if you want to use this best-in-class (imo), free-to-you lib "in production". otherwise you'll have to wait till i get around to it. it's not a priority for my personal use cases, since my code doesnt currently encounter these situations.

from dropcss.

leeoniya avatar leeoniya commented on May 23, 2024

btw, sorry for putting it so bluntly, but there's a lot of entitlement that goes around open source.

for unpaid open source projects, my primary interest is supporting my own use cases and no one else's suitability for "production" use. if it works for you, great, and you're welcome. if it doesn't, then please open a discussion or PR to support your use case or make your own private modifications to this MIT-licensed lib.

also, thanks for opening this issue - it's great to have additional test cases to find and fix bugs.

cheers!

from dropcss.

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.