UNPKG

docxtemplater

Version:

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js, the Browser and the command line

13 lines (12 loc) 433 B
"use strict"; var _require = require("./doc-utils.js"), pregMatchAll = _require.pregMatchAll; module.exports = function xmlMatcher(content, tagsXmlArray) { var res = { content: content }; var taj = tagsXmlArray.join("|"); var regexp = new RegExp("(?:(<(?:".concat(taj, ")[^>]*>)([^<>]*)</(?:").concat(taj, ")>)|(<(?:").concat(taj, ")[^>]*/>)"), "g"); res.matches = pregMatchAll(regexp, res.content); return res; };