Comments (7)
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.
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.
Here's an example:
https://repl.it/@heygrady/dropcss-example
from dropcss.
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.
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.
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.
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)
- Gulp task HOT 1
- support custom property fallback values
- PostCSS plugin HOT 5
- Nextjs integration example HOT 4
- didRetain() instead of result.sels HOT 2
- Using DropCSS with a Ghost blog HOT 1
- didRetain missing in npm published version HOT 3
- Enable hooks to drop / retain individual css declarations HOT 1
- As a postcss plugin ? HOT 1
- Whitespace inside a closing html tag breaks the parser HOT 6
- `NASTIES` regex incorrectly matches custom elements HOT 2
- Trying to get in touch regarding a security issue HOT 1
- new selectors and nesting HOT 1
- css selector parser cannot advance past unsupported pseudo classes with parenthesis HOT 7
- Class names containing html/body/head do not get dropped HOT 2
- Version Drift HOT 1
- Cannot read property '1' of null HOT 1
- Infinite loop on ":where" selector HOT 2
- Provide TypeScript type definitions
- Improperly purged p:not(.exclude, .special) { color: blue; font-weight: bold; }
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropcss.