Skip to content

Commit

Permalink
Merge branch 'bugfix-ucfirst' of https://github.com/spocke/yuidoc int…
Browse files Browse the repository at this point in the history
…o spocke-bugfix-ucfirst
  • Loading branch information
davglass committed May 10, 2012
2 parents 1b43638 + 584dd8d commit 7a8e7f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 9 additions & 5 deletions lib/builder.js
Expand Up @@ -17,11 +17,13 @@ var MD = require("node-markdown").Markdown,
* @return {String} The fixed string
*/
fixType = function(t) {
var firstChar = t.charAt(0),
upperFirstChar = firstChar.toUpperCase();
if (t.indexOf('.') === -1) {
var firstChar = t.charAt(0),
upperFirstChar = firstChar.toUpperCase();

if (firstChar !== upperFirstChar) {
return upperFirstChar + t.substring(1);
if (firstChar !== upperFirstChar) {
return upperFirstChar + t.substring(1);
}
}

return t;
Expand Down Expand Up @@ -137,13 +139,15 @@ YUI.add('doc-builder', function(Y) {

Y.DocBuilder.prototype = {
_parseCrossLink: function(item, raw) {
item = fixType(item);
var self = this;
var base = '../',
baseName = item,
newWin = false,
className = 'crosslink';

if (typeof self.data.classes[item] !== "undefined") {
item = fixType(item);
}

item = baseItem = Y.Lang.trim(item.replace('{', '').replace('}', ''));
//Remove Cruft
Expand Down
10 changes: 6 additions & 4 deletions lib/docparser.js
Expand Up @@ -16,11 +16,13 @@ YUI.add('docparser', function(Y) {
* @return {String} The fixed string
*/
fixType = function(t) {
var firstChar = t.charAt(0),
upperFirstChar = firstChar.toUpperCase();
if (t.indexOf('.') === -1) {
var firstChar = t.charAt(0),
upperFirstChar = firstChar.toUpperCase();

if (firstChar !== upperFirstChar) {
return upperFirstChar + t.substring(1);
if (firstChar !== upperFirstChar) {
return upperFirstChar + t.substring(1);
}
}

return t;
Expand Down

0 comments on commit 7a8e7f3

Please sign in to comment.