1 | /**
|
2 | @overview Escape HTML tags in descriptions.
|
3 | @module plugins/escapeHtml
|
4 | @author Michael Mathews <micmath@gmail.com>
|
5 | */
|
6 | ;
|
7 |
|
8 | exports.handlers = {
|
9 | /**
|
10 | Translate HTML tags in descriptions into safe entities.
|
11 | Replaces <, & and newlines
|
12 | */
|
13 | newDoclet: function(e) {
|
14 | if (e.doclet.description) {
|
15 | e.doclet.description = e.doclet.description
|
16 | .replace(/&/g, '&')
|
17 | .replace(/</g, '<')
|
18 | .replace(/\r\n|\n|\r/g, '<br>');
|
19 | }
|
20 | }
|
21 | };
|