diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-16 01:59:39 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-16 02:00:31 +0100 |
commit | bd65bb67e25a79b019d745b7262b2008ce2adb15 (patch) | |
tree | 89e1b032103a63737f1a703e6a943832ef261704 /node_modules/xmlbuilder/lib/XMLDTDEntity.js | |
parent | f91466595b651721690133f58ab37f977539e95b (diff) |
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/xmlbuilder/lib/XMLDTDEntity.js')
-rw-r--r-- | node_modules/xmlbuilder/lib/XMLDTDEntity.js | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/node_modules/xmlbuilder/lib/XMLDTDEntity.js index 4cfd42287..f27d56799 100644 --- a/node_modules/xmlbuilder/lib/XMLDTDEntity.js +++ b/node_modules/xmlbuilder/lib/XMLDTDEntity.js @@ -1,18 +1,14 @@ -// Generated by CoffeeScript 1.10.0 +// Generated by CoffeeScript 1.9.1 (function() { - var XMLDTDEntity, XMLNode, isObject, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; + var XMLDTDEntity, create, isObject; - isObject = require('./Utility').isObject; + create = require('lodash/create'); - XMLNode = require('./XMLNode'); - - module.exports = XMLDTDEntity = (function(superClass) { - extend(XMLDTDEntity, superClass); + isObject = require('lodash/isObject'); + module.exports = XMLDTDEntity = (function() { function XMLDTDEntity(parent, pe, name, value) { - XMLDTDEntity.__super__.constructor.call(this, parent); + this.stringify = parent.stringify; if (name == null) { throw new Error("Missing entity name"); } @@ -45,12 +41,44 @@ } } - XMLDTDEntity.prototype.toString = function(options) { - return this.options.writer.set(options).dtdEntity(this); + XMLDTDEntity.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += '<!ENTITY'; + if (this.pe) { + r += ' %'; + } + r += ' ' + this.name; + if (this.value) { + r += ' "' + this.value + '"'; + } else { + if (this.pubID && this.sysID) { + r += ' PUBLIC "' + this.pubID + '" "' + this.sysID + '"'; + } else if (this.sysID) { + r += ' SYSTEM "' + this.sysID + '"'; + } + if (this.nData) { + r += ' NDATA ' + this.nData; + } + } + r += '>'; + if (pretty) { + r += newline; + } + return r; }; return XMLDTDEntity; - })(XMLNode); + })(); }).call(this); |