You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change here is fairly straightforward, but wanted to get your thoughts before submitting a pull request. I'm creating templates in standalone html files, pretty much like:
My intention was for the filename comment to get rendered so that anyone looking at the rendered webpage later that wanted to change some copy could go find that file easily and make their edits. After tracing through the plugin, it looks like the comments disappear on line 212 of jquery.loadTemplate.js
var $templateHtml = template.children().clone(true);
By replacing children() with contents() we get all of the nodes (including the comments, yay!)... but that only works with HTML comments. If you're using
//javascript comments
or your template was declared on the same page, it would just render the plain text of your comment.
So what I'd like to implement is an extra option to use contents instead of children (the default would be false). Something like "renderComments" or "useContents" or "renderAllNodes" which would default to false. Flip it on if you know what you're doing, but otherwise everything would work exactly the same.
What do you think?
The text was updated successfully, but these errors were encountered:
The change here is fairly straightforward, but wanted to get your thoughts before submitting a pull request. I'm creating templates in standalone html files, pretty much like:
My intention was for the filename comment to get rendered so that anyone looking at the rendered webpage later that wanted to change some copy could go find that file easily and make their edits. After tracing through the plugin, it looks like the comments disappear on line 212 of jquery.loadTemplate.js
var $templateHtml = template.children().clone(true);
By replacing children() with contents() we get all of the nodes (including the comments, yay!)... but that only works with HTML comments. If you're using
//javascript comments
or your template was declared on the same page, it would just render the plain text of your comment.
So what I'd like to implement is an extra option to use contents instead of children (the default would be false). Something like "renderComments" or "useContents" or "renderAllNodes" which would default to false. Flip it on if you know what you're doing, but otherwise everything would work exactly the same.
What do you think?
The text was updated successfully, but these errors were encountered: