Skip to content

Commit

Permalink
Fixed issue with forced uppercase being applied to non internal types.
Browse files Browse the repository at this point in the history
  • Loading branch information
spocke committed May 10, 2012
1 parent 22e2da1 commit 584dd8d
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 584dd8d

Please sign in to comment.