-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom HTML elements are not supported by compiler #245
Comments
From the html5rocks great article about webcomponents:
|
Yes - I am aware of this problem for a while - this has to be fixed indeed |
I might be wrong, because now it seems to work.... don't know what i did wrong yesterday... |
Sorry for the noise... it apparently is working |
@b-laporte are you aware of the case where it doesn't work? I've just tried this test: it('should correctly compile templates with HTML elements containing -', function () {
var r =compiler.compile('{template x()}\n' +
'<x-div></x-div>\n' +
'{/template}', 'x.js');
assert.equal(r.errors.length, 0);
}); and it passes OK. |
Well - I remember it didn't work some while ago as I tried to create custom components with dashses and it didn't work - but it was 6 months ago or so.. So I guess the parser has been improved - but we should definitely add a compiler and a runtime time test to validate it.. |
OK, I'm going to push this test then - better to be safe than sorry. |
OK thanks - but I would also add a runtime test to validate that we do create the element with the dash name in the DOM... Note: I just remember the problem I had: if we want to create a component with a dash name we need to add a function to convert dashes to mixed case as template names need to be valid JS identifiers.. |
@b-laporte OK, I've pushed a test for the standard HTML case (2f408ba) and opened a separate issue for custom #space components (#248). |
Simply try to use a web component that follow the official naming convention from a template and you'll get a nice error !
gives
We basically need to had
-
as a valid character in the peg grammar.The text was updated successfully, but these errors were encountered: