UNPKG

@difftim/excelize

Version:

Excel Workbook Manager - Read and Write xlsx and csv Files.

40 lines (31 loc) 686 B
const BaseXform = require('../../base-xform'); // <c:f>Table!$B$1</c:f> class ATextXform extends BaseXform { get tag() { return 'c:f'; } render(xmlStream, model) { xmlStream.openNode('c:f'); xmlStream.writeText(model); xmlStream.closeNode(); } get model() { return this._text.join('').replace(/_x([0-9A-F]{4})_/g, ($0, $1) => String.fromCharCode(parseInt($1, 16))); } parseOpen(node) { switch (node.name) { case 'c:f': this._text = []; return true; default: return false; } } parseText(text) { this._text.push(text); } parseClose() { return false; } } module.exports = ATextXform;