Skip to content
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

Just a suggestion: Can I Write Some Comment Use doT? #165

Closed
chenjihu opened this issue Jun 25, 2015 · 3 comments
Closed

Just a suggestion: Can I Write Some Comment Use doT? #165

chenjihu opened this issue Jun 25, 2015 · 3 comments

Comments

@chenjihu
Copy link

As the title. e.g. {{//this is the comment}} , but it won't be rendered to the browser, which just for developer reading.

@btpoe
Copy link

btpoe commented Jul 10, 2015

You can write {{/* This is a comment */}}

@ouadi
Copy link

ouadi commented Aug 20, 2015

The above solution doesn't work when dot.templateSettings.strip is set to true.

The code:

dot.templateSettings.strip          = true;
var template = '' +
    '{{/* Some comment*/}}\n' +
    'Hello\n' +
    ';';
var compiled = dot.template(template, undefined, {});
console.log(compiled({}));

produces:

{{}}Hello

@epoberezkin
Copy link
Collaborator

duplicate of #135, see answer there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants