hyperhype/hyperscript

Accept unicode characters in selectors

tomek-he-him opened this issue · 1 comments

Any unicode character which doesn’t have a special meaning in CSS can be used in a class/id selector without escaping: http://jsbin.com/talosehanu/3/edit?html,css,js,console,output.

More info here: https://mathiasbynens.be/notes/css-escapes.

In this PR I’ve ignored the rules for escaping and un-escaping characters. For example, div.a\#b#c\.d should theoretically be read as <div class="a#b" id="c.d" />. That’s implementable, but it costs a lot of code and I don’t think it’s worth it. Would anyone really use things # in a selector? But @dominictarr let me know if you’d rather have your mini parser as close to the spec as possible.

A lot of tests are failing on my box. I’ve added one test and made sure I don’t break any other.

Sorry I thought I’m posting a PR.