@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
19 lines • 482 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.escapeHTML = escapeHTML;
/**
* Escapes HTML special characters in a string.
*
* @param str - The string to escape
* @returns The escaped string
*/
function escapeHTML(str) {
return str?.replace(/[&<>"']/g, (tag) => ({
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
}[tag] ?? tag));
}
//# sourceMappingURL=doc-escape.js.map