sanitize.js 583 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.sanitize = void 0;
  4. /**
  5. * Replaces all spaces with the Unicode No-break space.
  6. * ref: http://www.fileformat.info/info/unicode/char/a0/index.htm
  7. *
  8. * IE would otherwise collapse all spaces into one. This is useful
  9. * e.g. in tests when you want to compare the actual DOM text content
  10. * without having to add the unicode character in the place of all spaces.
  11. */
  12. function sanitize(text) {
  13. return text.replace(/ /g, '\u00A0');
  14. }
  15. exports.sanitize = sanitize;
  16. //# sourceMappingURL=sanitize.js.map