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

escaped characters are wrongly translated into html. e.g. < becomes > while it shouldn't be #57

Closed Abdelkrim closed 11 years ago

Abdelkrim commented 11 years ago

This piece of html

<p>Note the lack of the <code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;</code>, which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.</p>

<p>&copy; Company 2013</p>

Becomes, by using http://html2jade.aaron-powell.com

    p
    | Note the lack of the
      code <meta name="viewport" content="width=device-width, initial-scale=1.0">
      | , which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.
    p © Company 2013

it should be

    p
    | Note the lack of the
      code **&lt;**meta name="viewport" content="width=device-width, initial-scale=1.0"**&gt;**
      | , which disables the zooming aspect of sites in mobile devices. In addition, we reset our container's width and are basically good to go.
    p **&copy;** Company 2013
donpark commented 11 years ago

Fix actually over-encodes, encoding common characters like period and comma, but character entity encoding module I'm using is not configurable. In return for tediously encoded output, some safety is gained so it's an even trade I think.

Abdelkrim commented 11 years ago

Don, i understand, it is tedious to check the complete HTML we are translating against the jade file

Thanks for the swift answer

Don Park notifications@github.com wrote:

Fix actually over-encodes, encoding common characters like period and comma, but character entity encoding module I'm using is not configurable. In return for tediously encoded output, some safety is gained so it's an even trade I think.


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

donpark commented 11 years ago

You're welcome. Issue report caught me at the right time (weekend) and I figured you guys ran into the problem in midst of a large conversion job.

Please do let me know if there are any corner cases I didn't catch with this fix. Thx.