dxw / Fammel

A Haml parsing library for PHP
48 stars 5 forks source link

There's no detection of self-closing tags, and no way to specify it expliticly #1

Open dxw opened 14 years ago

dxw commented 14 years ago

Stolen from the HAML Reference:

The forward slash character, when placed at the end of a tag definition, causes the tag to be self-closed. For example:

%br/
%meta{'http-equiv' => 'Content-Type', :content => 'text/html'}/

is compiled to:

<br />
<meta http-equiv='Content-Type' content='text/html' />

Some tags are automatically closed, as long as they have no content. meta, img, link, script, br, and hr tags are closed by default. This list can be customized by setting the :autoclose option. For example:

%br
%meta{'http-equiv' => 'Content-Type', :content => 'text/html'}

is also compiled to:

<br />
<meta http-equiv='Content-Type' content='text/html' />