-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow to set the file size limit of image inlining to zero to inline all files #789
Conversation
why u no tests? |
There doesn't seem to be an appropriate framework to do this kind of test and I have no interest in adjusting the test framework for this very minor change. All the existing tests pass. Feel free to add tests or reject this pull request based on this response. |
He's right, I think we only have diff based testing in place atm. We should change that :D |
@@ -51,24 +51,23 @@ var mimes = { | |||
module.exports = function(options) { | |||
options = options || {}; | |||
|
|||
var sizeLimit = options.limit || 30000 | |||
var sizeLimit = (options.limit != null) ? options.limit : 30000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded parens
You could pass |
I think in that case intent would be more clear. |
makes sense. The diff testing is pretty slick though. |
@GEDDesign I wouldn't get rid of diff testing at all |
Amended my commit, I forgot you guys don't like readable code so much :P -Infinity won't work when using the plugin from the command line as it is not valid JSON. I'm ok with -1, just say the word. I think 0 is pretty clear though (as in: "zero file size limit"). |
I do like the |
But to be honest if we are gonna special case |
Oh nevermind we got that. We should document it then, and I'm down to merge it |
limit: 0 could be interpreted as "limit it to zero". What about limit: false? |
Yep, in that regard limitting to zero is same as limiting to |
Pick one now. |
So I guess the optimal solution would be:
|
Although you could also disable limits with |
… all files. Also fix some var-redeclarations.
done. |
Now it's not defaulting to |
Allow to set the file size limit of image inlining to zero to inline all files
Fixed in master |
See the title :)
{limit: 0} will now inline all images.