src/lib/Parser.js
/**
Normalizes the given XML string by stripping a byte order mark (if present) and
replacing CRLF sequences and lone CR characters with LF characters.

@param {string} xml
@returns {string}
*/
Normalizes the given XML string by stripping a byte order mark (if present) and
replacing CRLF sequences and lone CR characters with LF characters.
Normalizes the given XML string by stripping a byte order mark ( if present ) and replacing CRLF sequences and lone CR characters with LF characters .
function normalizeXmlString(xml) {
  if (xml[0] === '\uFEFF') {
    xml = xml.slice(1);
  }
  return xml.replace(/\r\n?/g, '\n');
}
function normalizeXmlString ( xml ) { if ( xml [ 0 ] === '\uFEFF' ) { xml = xml . slice ( 1 ) ; } return xml . replace ( / \r\n? / g , '\n' ) ; }
Normalizes the given XML string by stripping a byte order mark (if present) and
replacing CRLF sequences and lone CR characters with LF characters.
Normalizes the given XML string by stripping a byte order mark ( if present ) and replacing CRLF sequences and lone CR characters with LF characters .