alissonmbr / react-xml-viewer

MIT License
30 stars 20 forks source link

Component should handle bad inputs #3

Closed fdemello closed 4 years ago

fdemello commented 5 years ago

Unless you paste text that is already in XML form, this component crashes. For example, if you have a text area where users will enter text to be formatted as XML, the moment < is entered the component crashes with the error below.

index.es.js:2872 Uncaught TypeError: Cannot read property 'map' of undefined
    at Elements (index.es.js:2872)
var Elements = function Elements(_ref2) {
  var elements = _ref2.elements,
      theme = _ref2.theme,
      indentation = _ref2.indentation,
      indentSize = _ref2.indentSize;
  return elements.map(getElement(theme, indentation, indentSize));
};
alissonmbr commented 4 years ago

Sorry to take so long. The version 1.1.0 solve this problem. Thanks for reporting this bug