marko/compiler/ast/HtmlComment.js
Patrick Steele-Idem 8c96302550 Fixes #197 - Better attribute code generation
Use attr helper and handle attribute escaping
Also improved AST and added walking capability
2016-01-07 16:05:26 -07:00

25 lines
524 B
JavaScript

'use strict';
var Node = require('./Node');
class HtmlComment extends Node {
constructor(def) {
super('HtmlComment');
this.comment = def.comment;
}
generateHtmlCode(codegen) {
var comment = this.comment;
var literal = codegen.builder.literal;
codegen.addWrite(literal('<--'));
codegen.addWrite(comment);
codegen.addWrite(literal('-->'));
}
walk(walker) {
this.comment = walker.walk(this.comment);
}
}
module.exports = HtmlComment;