Fammel icon indicating copy to clipboard operation
Fammel copied to clipboard

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

Open dxw opened this issue 16 years ago • 0 comments

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' />

dxw avatar Dec 12 '09 23:12 dxw