Closed gavruk closed 10 years ago
This is designed behavior.
The indent rule inside <script>
should use indent code from javascript
file type.
I know the template usage.
But I don't like it, I don't think this is a correct way to use <script>
. So I will not fix this.
But a patch is always welcome.
What way of defining templates do you prefer? Is there are any other way? Hidden div
doesn't work the same way
HTML5 provides a new element called template
.
Which is invisible but will be parsed.
Let it easy to clone and reuse.
And I am using handlebars but precomipled to JS functions. You can see the document for more information.
Just wanted to mention that AngularJS also uses the script tag for html templates with type="text/ng-template"
. I think this is technically valid according to the spec. Script tags can potentially be used for any scripting language by setting the type
attribute (defaults to javascript if missing). The only posible solution I can think of is to check the type
attribute to use different syntax. This doesn't necessarily sound very easy though.
I agree the template
tag will be quite useful once it has more support.
Hi, I trace the code and discovered:
text/html
and text/template
is allowed template type for <script
Childrens of these two type of script tag will be indent.
Others will not.
And I just add ng-template
support.
Hi. Html indent doesn't work inside
<script>
tag. I use script tag for html template. I found that indent from this repo causes this issue. When I turned off html indent from this repo, indenting stated working as excepted.