2014-10-20 16:56:45 -04:00
|
|
|
/**
|
|
|
|
@overview Escape HTML tags in descriptions.
|
|
|
|
@module plugins/escapeHtml
|
|
|
|
@author Michael Mathews <micmath@gmail.com>
|
|
|
|
*/
|
2014-10-22 10:11:40 -04:00
|
|
|
'use strict';
|
2014-10-20 16:56:45 -04:00
|
|
|
|
|
|
|
exports.handlers = {
|
|
|
|
/**
|
|
|
|
Translate HTML tags in descriptions into safe entities.
|
|
|
|
Replaces <, & and newlines
|
|
|
|
*/
|
|
|
|
newDoclet: function(e) {
|
|
|
|
if (e.doclet.description) {
|
|
|
|
e.doclet.description = e.doclet.description
|
2015-01-28 15:33:44 -05:00
|
|
|
.replace(/&/g, '&')
|
|
|
|
.replace(/</g, '<')
|
2014-10-20 16:56:45 -04:00
|
|
|
.replace(/\r\n|\n|\r/g, '<br>');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|