mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
28 lines
577 B
JavaScript
28 lines
577 B
JavaScript
'use strict';
|
|
var Node = require('./Node');
|
|
|
|
class DocumentType extends Node {
|
|
constructor(def) {
|
|
super('DocumentType');
|
|
this.documentType = def.documentType;
|
|
}
|
|
|
|
generateHtmlCode(codegen) {
|
|
var builder = codegen.builder;
|
|
|
|
return [
|
|
builder.htmlLiteral('<!'),
|
|
builder.html(codegen.generateCode(this.documentType)),
|
|
builder.htmlLiteral('>')
|
|
];
|
|
}
|
|
|
|
toJSON() {
|
|
return {
|
|
type: this.type,
|
|
value: this.value
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = DocumentType; |