Closed dimensi closed 7 years ago
That's not a bug. CoffeeScript expression:
useTabs = true if options.tabs
compiles to:
if (options.tabs) {
useTabs = true;
}
it is BUG!!! If use your script on client side and change your tabs on true 1 TIME, tabs option always will be TRUE. Only RELOAD page fix this! Your expression check only true and always return true... Sorry for my english, i hope you understand me. Thank you advance. You can see in real, how bug work. https://html2pug.herokuapp.com/ https://github.com/edDimensi/html2pug Try swith on tabs and again space, you will see, server now all time send tabs.
@edDimensi I now see where you're coming from. html2jade started out as a command-line tool and browser support was added later so there could be other corner-case issues like this. JS module's singleton semantic also contributed to the problem.
Anyway, other flags also had similar problem so I went ahead and fixed them all directly without merging your PR.
Thx for reporting the bug and pushing back when I made erroneous conclusions.
I do not know much English. Always gives true, if at least one time to set true. Thank you for your work.