donpark / html2jade

Converts HTML to Jade template. Not perfect but useful enough for non-daily conversions.
MIT License
1.18k stars 157 forks source link

The option 'donotencode' dose not work when using html2jade.convertHtml() #63

Closed 0x58584C closed 10 years ago

0x58584C commented 10 years ago

Hi, donpark!

Firstly, I am grateful for your project :)

Secondly, I got a problem and need help. I installed the html2jade package with npm install, and required it in my code. When I tried to convert html using html2jade.convertHtml() with an option {donotencode: true}, I got a wrong result.

My code:

var html2jade = require('html2jade');
html2jade.convertHtml('${2:value="${3}"}', {donotencode: true}, function (err, jade) {
  console.log(jade);
});

The result:

html
  body ${2:value="${3}"}

And what I actually expected:

html
  body ${2:value="${3}"}

Any help, would be great.

Thanks, Thinrey

donpark commented 10 years ago

That's because @borisjoffe's pull request added donotencode flag support to command line calls, not in convertHtml nor convertDocument.

I'll remedy the difference when I can but it should be easy enough to patch yourself if you're in a hurry.

sandro-pasquali commented 10 years ago

+1