Open GoogleCodeExporter opened 8 years ago
I hacked the following up for use at work today:
/** Find symbol {@link ...} strings in text and turn into html links */
function resolveLinks(str, from) {
str = str.replace(/\{@link ([^}]+)\}/gi,
function(match, symbolName) {
symbolName = symbolName.trim();
var index = symbolName.indexOf(' ');
if (index > 0) {
var label = symbolName.substring(index + 1);
symbolName = symbolName.substring(0, index);
return new Link().toSymbol(symbolName).withText(label);
} else {
return new Link().toSymbol(symbolName);
}
}
);
return str;
}
Original comment by ryan.gus...@gmail.com
on 18 Dec 2009 at 11:15
Add in the following to support the JavaDoc inline {@code code} tag:
str = str.replace(/\{@code ([^}]+)\}/gi,
function(match, code) {
return '<code>' + code + '</code>';
}
);
Original comment by ryan.gus...@gmail.com
on 23 Dec 2009 at 7:21
Original issue reported on code.google.com by
micmath
on 13 Aug 2008 at 12:53