On Oct 16, 4:34 pm, "Mislav Marohnić" <[EMAIL PROTECTED]>
wrote:
> 2008/10/16 Noah Sussman <[EMAIL PROTECTED]>
>
> don't expect this to handle all the spaghetti erb out there, but I
> think html2haml is actually much more usable with my commits and greatly
> reduces (but not eliminates!) the amount of hand-sanitizing

I have been converting ERBs with html2haml all week, and today, with
your fix, it's going much easier and faster.  Thanks again.  With that
bug out of the way I feel pretty confident about being able to handle
any ERB-to-HAML conversions that come up in the future as well.

As far as I can tell, html2haml seems pretty robust over all.  I do
have to fix the indentation by hand for some complex ERB blocks, but I
think that's only to be expected.

I might mention another (minor) issue I noticed is that on line 28 of
html.rb (the one from Mislav's commit mentioned earlier in this
thread) there is this regex:
  match_to_html(template, /<%(.*?)-?%>/m,  'silent')

but there is a dash missing I think.  It should be:
  match_to_html(template, /<%-(.*?)-?%>/m,  'silent')

because otherwise "silent" RHTML tags like
  <%- form_for ... -%>

get translated with two leading dashes, not one, as in:
  - - form_for ...

but if I add that dash in the regex, it works as I expect it should.

"Silent" end blocks also don't get stripped, they wind up in the HAML
as
  - end

but so far I haven't read deeply enough to understand how end blocks
are stripped, so I don't understand yet why that's happening.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to