mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added plugin to escape HTML tags in descriptions.
This commit is contained in:
parent
bd7a5631c1
commit
bf5d6eb505
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "JSDoc",
|
||||
"version": "3.0.0alpha",
|
||||
"revision": "1318543155292",
|
||||
"revision": "1318543678039",
|
||||
"description": "An automatic documentation generator for javascript.",
|
||||
"keywords": [ "documentation", "javascript" ],
|
||||
"licenses": [
|
||||
|
||||
17
plugins/escapeHtml.js
Normal file
17
plugins/escapeHtml.js
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
@overview Escape HTML tags in descriptions.
|
||||
@module plugins/escapeHtml
|
||||
@author Michael Mathews <micmath@gmail.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
Translate HTML tags in descriptions into safe entities.
|
||||
*/
|
||||
exports.newDoclet = function(e) {
|
||||
if (e.doclet.description) {
|
||||
e.doclet.description = e.doclet.description
|
||||
.replace(/&/g,'&')
|
||||
.replace(/</g,'<')
|
||||
.replace(/\n/g, '<br>');
|
||||
}
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user