-
Notifications
You must be signed in to change notification settings - Fork 284
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
content of script type="text/ng-template" shoul be parsed as html #228
Comments
Maybe the CDATA wrapper should only be output for |
As I undertand how vibe.d interprets the templates (which might not be correct):
One solution is this - under assumption that content needs to be parsed in order to be interpreted as html:
This is specific solution to allow AngularJS to be usable (Otherwise the vibe is quite liming the usage of AngularJS). It is not solution for other frameworks that use script tag in similar way, but at the end, I think it will be easy to add the same exception for other values of 'type' attribute. Btw. if jade do not processes the [script type="text/ng-template"] as html, it is also doing it wrong. |
Ah right, I forgot that
Jade also treats |
to update the code after updating the vibe, user would need to add "." after each script and style tag (might be able to do global text replace, but maybe not with 100% automatic accuracy because they are common words)
using option 2 you will need to introduce additional modifier "<" - or other character you wish, to let the user specify that inner content is html. There is now at least one modifier now - ".", so this will mean additional complexity - now you will have 2 modifiers overriding each other, where only one (".") would be enough the decision is up to you. |
What I was thinking was something like keeping the old behavior only for style with either no type or type="text/css", but output a warning to add a ".". For all other types, just switch to the new behavior (assuming that >90% of the script tags will be normal CSS). Then after a while both, the old behavior and the warning would be removed. |
To be 100% you would need to add warning to all usages of script/style tags. But give that they are all currently not parsed, I cannot imagine any situation where your proposal would cause any trouble in practice. I think it is very good to have gradual transition. |
Angular uses script tag with type text/ng-template as inline html template
see: http://docs.angularjs.org/api/ng.directive:script
vibe.d currently handles all script tag content as CDATA. Whole ouput of script tag is uparsed sent to browser. This prevents this usage of cript tag.
vibe.d should for all script of type="text/ng-template" parse and evalute content as normal html
The text was updated successfully, but these errors were encountered: