twilson63 / html2haml

Convert HTML Snippets to Haml
http://html2haml.heroku.com
MIT License
180 stars 82 forks source link

empty tags #9

Closed axaluss closed 12 years ago

axaluss commented 13 years ago

empty tags are not converted properly

...
<script …>
</script>
</head>
<body>

->

%script
  %body
twilson63 commented 13 years ago

Cool, thanks for the feedback, I will take a look at.

twilson63 commented 13 years ago

Reproduced...

<html>
<head>
<script type='text/javascript'>
</script>
</head>
<body>
</body>
</html>

%html
  %head
    :javascript
        %body

Should Equal

%html
  %head
    :javascript
   %body

I wonder if it is an empty script tag, should we just strip it out all together? Why would you have an empty script tag?

axaluss commented 13 years ago

it can damage your html output maybe not only during development and slow you down. are there other tags which dont like to be empty?

twilson63 commented 13 years ago

My guess it would be the same for the

<style> 

tag as well.

twilson63 commented 12 years ago

Fixed in html2haml gem..

<script src=''>
</script>
</head>
<body>
%script{:src => ""}
%body/