diff --git a/build/jsdoc-toolkit/templates/jsdoc/class.tmpl b/build/jsdoc-toolkit/templates/jsdoc/class.tmpl
index b3bc4350..60536d30 100644
--- a/build/jsdoc-toolkit/templates/jsdoc/class.tmpl
+++ b/build/jsdoc-toolkit/templates/jsdoc/class.tmpl
@@ -59,7 +59,7 @@
Extends {+ inheritedClassLinks.join(', ') +}
{+processInlineTags(data.classDesc)+}
+{+processInlineTags(data.classDesc)+}{+processInlineTags(data.desc)+}
+{+example+}@@ -89,7 +89,7 @@
{+processInlineTags(data.desc)+}
+{+processInlineTags(operator.desc)+}
+
- {+processInlineTags(data.desc)+}
..
-> ..str = str.replace(/<(\/)*(code)>/g, '<$1pre>'); @@ -292,9 +293,59 @@ function processInlineTags(str) { return '' + code + ''; } ); + + var lineBreak = java.lang.System.getProperty('line.separator'); + + // Convert any type of lineBreak to the one we're using now: + str = str.replace(/(\r\n|\n|\r)/g, function(match, lineBreak) { + return lineBreak; + }); + + // Replace inline
with
+ str = str.replace(/[ \t]*([^\n\r]*?)[ \t]*<\/code>/g, function(match, content) {
+ return '' + content + '';
+ });
+
+ // Put code and pre tags on the same line as the content, as white-space: pre is set:
+ str = str.replace(/(<(?:code|pre)>)\s*([\u0000-\uffff]*?)\s*(<\/(?:code|pre)>)/g, function(match, open, content, close) {
+ // Filter out the first white space at the beginning of each line, since
+ // that stems from the space after the * in the comment and replace
+ // with , to fix a IE problem where lighter.js does not receive
+ // linebreaks from code tags weven when white-space: pre is set.
+ return '' + content.replace(/(\r\n|\n|\r) /mg, function(match, lineBreak) {
+ return lineBreak;
+ }) + '
';
+ });
+ // Empty lines -> Paragraphs
+ if (!param.stripParagraphs) {
+ if (param.wrapInParagraphs === undefined || param.wrapInParagraphs)
+ str = '' + str.trim() + '
';
+ str = str.trim().replace(/(\r\n|\n|\r)\s*(\r\n|\n|\r)/g, function(match, lineBreak) {
+ return '' + lineBreak + '';
+ });
+ // Automatically put
at the end of sentences with line breaks.
+ // Match following
and tags and swallow them. This happens when
+ // the original content contains these.
+ str = str.trim().replace(/([.:?!;])\s*(\r\n|\n|\r)(\s*)(<\/p>|
|)/g, function(match, before, lineBreak, whiteSpace, after) {
+ // Include following whiteSpace as well, since for code blocks they are relevant (e.g. indentation on new line)
+ return before + '
' + lineBreak + whiteSpace + '';
+ });
+ // Filter out
tags within and around and blocks again
+ str = str.replace(/((?:\s*|)<(?:code|pre)[^>]*>[\u0000-\uffff]*<\/(?:code|pre)>(?:\s*<\/p>|))/g, function(match, code) {
+ return stripTags(code, 'p');
+ });
+ // Filter out empty paragraphs
+ str = str.replace(/
<\/p>/g, '');
+ }
+
return str;
}
+function stripTags(str, tag) {
+ var tag = tag || '.*?'; // Default: all tags
+ return str.replace(new RegExp('<' + tag + '>|' + tag + '>', 'g'), '');
+}
+
function copyStatic(dir) {
var dir = publish.conf.templatesDir + 'resources/';