diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 7 | ||||
-rw-r--r-- | lib/handlebars/compiler/helpers.js | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index 49bdc33..e05ceec 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -196,14 +196,13 @@ var AST = { this.stringModeValue = bool === "true"; }, - CommentNode: function(comment, locInfo) { + CommentNode: function(comment, strip, locInfo) { LocationInfo.call(this, locInfo); this.type = "comment"; this.comment = comment; - this.strip = { - inlineStandalone: true - }; + this.strip = strip; + strip.inlineStandalone = true; } }; diff --git a/lib/handlebars/compiler/helpers.js b/lib/handlebars/compiler/helpers.js index 758c740..20f13d6 100644 --- a/lib/handlebars/compiler/helpers.js +++ b/lib/handlebars/compiler/helpers.js @@ -7,6 +7,11 @@ export function stripFlags(open, close) { }; } +export function stripComment(comment) { + return comment.replace(/^\{\{~?\!-?-?/, '') + .replace(/-?-?~?\}\}$/, ''); +} + export function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { /*jshint -W040 */ |