How to use the ltx/lib/escape.escapeXML function in ltx

To help you get started, we’ve selected a few ltx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xmppjs / xmpp.js / packages / xml / lib / tag.js View on Github external
function error(literals, substitutions) {
  let s = ''
  for (let i = 0; i < substitutions.length; i++) {
    s += literals[i]
    s += escapeXML(substitutions[i])
  }
  s += literals[literals.length - 1]
  return new Parser.XMLError(s)
}
github xmppjs / xmpp.js / packages / xml / lib / tag.js View on Github external
str = str.trim()
      if (str) {
        element.t(str)
      }
    }
  }

  parser.onEndElement = (el, length) => {
    if (length === 1) {
      tree = el
    }
  }

  for (i = 0; i < substitutions.length; i++) {
    parser.write(literals[i])
    parser.write(escapeXML(substitutions[i]))
  }
  parser.end(literals[literals.length - 1])

  return tree
}