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 | '&': '&',
|
8 | '<': '<',
|
9 | '>': '>',
|
10 | '"': '"',
|
11 | "'": '''
|
12 | };
|
13 | return entityMap[s];
|
14 | });
|
15 | }
|
16 | export { Text as default, escapeText };
|
17 | //# sourceMappingURL=text.js.map |
\ | No newline at end of file |