Skip to content

Conversation

alanpoulain
Copy link

I tried to handle PhantomJS arguments the better way I could think of.
I you have better ideas, please tell me.

@@ -35,6 +35,12 @@ function PDF (html, options) {
if (this.options.filename) this.options.filename = path.resolve(this.options.filename)
if (!this.options.phantomPath) this.options.phantomPath = phantomjs && phantomjs.path
this.options.phantomArgs = this.options.phantomArgs || []
this.options.phantomArgs = this.options.phantomArgs.map(function (elt) {
if (elt.substring(0, 2) !== '--') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO that's too much magic. I'd support --phantomArgs "--ignore-ssl-errors=yes". Then you'll also get a string in here and we can just split it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, it would be better but unfortunately it does not work like this.
The double quotes are not kept and yargs-parser consider it as a normal argument.

@acrolink
Copy link

Is this feature committed to latest release?

@alanpoulain
Copy link
Author

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants