donpark / html2jade

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

Null Class value (class="") messes up the translation #33

Closed soumendra closed 12 years ago

soumendra commented 12 years ago

Resulting in jade code like tr. or tr#even. which get rendered incorrectly (differently from what was intended by and rendered from the html) at least in node.js using express and jade.

soumendra commented 12 years ago

Is

tr.

valid jade?

donpark commented 12 years ago

not sure if "tr." is valid or not.

regardless, this is a bug.

donpark commented 12 years ago

Fixed in version 0.1.18 and published to NPM.

donpark commented 12 years ago

Fix was to ignore empty class attributes.

If you have a use-case that needs output to be something like below, let me know:

tr(class="")
soumendra commented 12 years ago

Wow, that was fast.

This fixes everything I needed for the time being. Thanks. :)

On 21 June 2012 03:55, Don Park reply@reply.github.com wrote:

Fix was to ignore empty class attributes.

If you have a use-case that needs output to be something like below, let me know:

   tr(class="")


Reply to this email directly or view it on GitHub: https://github.com/donpark/html2jade/issues/33#issuecomment-6469280

ghost commented 9 years ago

Fix was to ignore empty class attributes.

Which leads to problems on my specific case, where empty attributes won't be set to some default but should remain empty. Since these are ignored from html2jade, these are set default.

donpark commented 9 years ago

sorry about that. a selfish-suggestion: just filter class="" out using sed or awk.

EDIT: Oops. just realized your issue is exact opposite. It's been too long.

ghost commented 9 years ago

Never mind, I troubleshot this by setting some placeholder class-name temporarily. However, I suggest supporting empty attribute-values.

Thank you for your quick response!