eb4bc787767e19bdd28f4d780ac0677a496de3046ad521420c01c9d0de55e733f2a73d1312f9c5891748a0a66f0d87e57aa4ea4d5964e3e4c06ea1bc4e0ab4 410 B

1234567891011121314151617
  1. import { TextBlot } from 'parchment';
  2. class Text extends TextBlot {}
  3. function escapeText(text) {
  4. return text.replace(/[&<>"']/g, s => {
  5. // https://lodash.com/docs#escape
  6. const entityMap = {
  7. '&': '&amp;',
  8. '<': '&lt;',
  9. '>': '&gt;',
  10. '"': '&quot;',
  11. "'": '&#39;'
  12. };
  13. return entityMap[s];
  14. });
  15. }
  16. export { Text as default, escapeText };
  17. //# sourceMappingURL=text.js.map