UNPKG

410 BJavaScriptView Raw
1import { TextBlot } from 'parchment';
2class Text extends TextBlot {}
3function 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}
16export { Text as default, escapeText };
17//# sourceMappingURL=text.js.map
\No newline at end of file