quill
Version:
Your powerful, rich text editor
16 lines (15 loc) • 361 B
JavaScript
import { TextBlot } from 'parchment';
class Text extends TextBlot {}
// https://lodash.com/docs#escape
const entityMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
function escapeText(text) {
return text.replace(/[&<>"']/g, s => entityMap[s]);
}
export { Text as default, escapeText };
//# sourceMappingURL=text.js.map