1
0
forked from Rowland/EG
EG/Cesium-1.132/node_modules/jsdoc/plugins/escapeHtml.js
2025-08-25 17:48:13 +08:00

19 lines
464 B
JavaScript

/**
* Escape HTML tags in descriptions.
*
* @module plugins/escapeHtml
*/
exports.handlers = {
/**
* Translate HTML tags in descriptions into safe entities. Replaces <, & and newlines
*/
newDoclet({doclet}) {
if (doclet.description) {
doclet.description = doclet.description
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/\r\n|\n|\r/g, '<br>');
}
}
};