haml-coffee icon indicating copy to clipboard operation
haml-coffee copied to clipboard

Special characters in tag and attribute names

Open mikeyhew opened this issue 8 years ago • 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

mikeyhew avatar Feb 24 '16 14:02 mikeyhew

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 :).

vendethiel avatar Feb 24 '16 16:02 vendethiel

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.

mikeyhew avatar Feb 25 '16 02:02 mikeyhew