creationix / haml-js

Haml ported to server-side Javascript. This is a traditional server-side templating language. Tested with node-js
MIT License
901 stars 110 forks source link

Support single quotes #91

Open ypresto opened 9 years ago

ypresto commented 9 years ago

Related to #83.

Currently single quote attributes compiled into html_escape('single_quoted_string'). This is just work but not very good at performance and backslashes (perhaps attr: 'a\b' compiled into html_escape('\') and it should be html_escape('\\')).

This PR adds support for compiling single quoted attributes into simple string.

adamdicarlo commented 9 years ago

@ypresto cool, this is a big help, though it doesn't seem to support quotes inside single quotes, like

%foo(attr='a"b"c')

whereas

%foo(attr="a'b'c")

works