@difftim/excelize
Version:
Excel Workbook Manager - Read and Write xlsx and csv Files.
59 lines (58 loc) • 1.22 kB
JavaScript
const BaseXform = require('../../base-xform');
const APXform = require('./a-p-xform');
class CRichXform extends BaseXform {
constructor() {
super();
this.map = {
'a:p': new APXform()
};
}
get tag() {
return 'c:rich';
}
render(xmlStream, model) {
xmlStream.openNode(this.tag);
this.map['a:p'].render(xmlStream, model);
xmlStream.closeNode();
}
parseOpen(node) {
if (this.parser) {
this.parser.parseOpen(node);
return true;
}
switch (node.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[node.name];
if (this.parser) {
this.parser.parseOpen(node);
}
break;
}
return true;
}
parseText(text) {
if (this.parser) {
this.parser.parseText(text);
}
}
parseClose(name) {
if (this.parser) {
if (!this.parser.parseClose(name)) {
this.parser = undefined;
}
return true;
}
switch (name) {
case this.tag:
this.model = this.map['a:p'].model;
return false;
default:
return true;
}
}
}
module.exports = CRichXform;
//# sourceMappingURL=c-rich-xform.js.map