netzpirat/haml-coffee

Special characters in tag and attribute names

mikeyhew opened this issue · 2 comments

The following examples are both rendering wrong:

%ul
  / Breaks because of asterisk (*)
  %li(*ngFor="#i in [1,2,3]")
    This is tag number {{i}}.
/ non-ascii characters
%my-tág

The first one seems "correct" to me, but maybe we should be able to quote attibutes.

The second one is probably a regexp that's a tad too simple, i'd gladly accept a PR with a test that fixes it :).

Alright, I'll see if I can get around to it :). Hopefully it won't impact performance too badly. What do you think about just supporting every valid XML name for tag and attribute names, as described here and referenced in the HTML spec here?

Re the first example, that's the new Angular 2.0 syntax, and I'm not even sure it's valid HTML. If I end up using these together in my workflow, I'll probably create a fork that supports a * in front of attribute names.