UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

15 lines (12 loc) 299 B
/* Escape XML Entities HACK: this is just a cheap implementation to escape XML entities */ function encodeXMLEntities (str) { return String(str) .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') } export default encodeXMLEntities