diff --git a/package.json b/package.json index b39343b6..794dca3b 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/plugins/escapeHtml.js b/plugins/escapeHtml.js new file mode 100644 index 00000000..aaef19d2 --- /dev/null +++ b/plugins/escapeHtml.js @@ -0,0 +1,17 @@ +/** + @overview Escape HTML tags in descriptions. + @module plugins/escapeHtml + @author Michael Mathews + */ + +/** + 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(/'); + } +};