mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Qouted names keep their quotes.
This commit is contained in:
parent
44df2ede7e
commit
6a1a46aeba
@ -271,8 +271,7 @@
|
||||
}
|
||||
|
||||
if (tagAbout.setsDocletDesc) {
|
||||
tags[tags.length] = parse_tag.fromText('desc '+tags[i].desc);
|
||||
print('>>> tag desc is '+tags[i].toSource());
|
||||
tags[tags.length] = parse_tag.fromText('desc '+tags[i].value);
|
||||
}
|
||||
|
||||
if (tags[i].name === 'name') {
|
||||
|
||||
@ -86,9 +86,9 @@
|
||||
var atoms = [],
|
||||
cursor = 0;
|
||||
path = path.replace(/(".+?")/g, function($) {
|
||||
$ = $.slice(1, -1);
|
||||
//$ = $.slice(1, -1); // trim quotes?
|
||||
|
||||
var token = '@' + atoms.length + '@';
|
||||
var token = '@{' + atoms.length + '}@';
|
||||
atoms.push($);
|
||||
return token;
|
||||
});
|
||||
@ -98,16 +98,12 @@
|
||||
splitAt = path.lastIndexOf(splitOn),
|
||||
prefix = (splitOn && splitAt !== -1)? path.slice(0, splitAt) : '';
|
||||
|
||||
if (splitOn === '#' || splitOn === '~') { prefix = prefix + splitOn; }
|
||||
if ('#~'.indexOf(splitOn) > -1) { prefix = prefix + splitOn; }
|
||||
|
||||
// restore quoted strings back again
|
||||
for (var i = 0, leni = atoms.length; i < leni; i++) {
|
||||
prefix = prefix.replace('@'+i+'@', atoms[i]);
|
||||
shortname = shortname.replace('@'+i+'@', atoms[i]);
|
||||
|
||||
// remove quotes from shortnames
|
||||
///^"(.+)"$/.test(shortname);
|
||||
//if (RegExp.$1) { shortname = RegExp.$1; }
|
||||
prefix = prefix.replace('@{'+i+'}@', atoms[i]);
|
||||
shortname = shortname.replace('@{'+i+'}@', atoms[i]);
|
||||
}
|
||||
|
||||
return [prefix, shortname];
|
||||
|
||||
@ -344,4 +344,20 @@
|
||||
new TagDefinition('version', {
|
||||
isExported: true
|
||||
});
|
||||
|
||||
/** Syntax: @category <text>
|
||||
@property {TagDefinition} category
|
||||
@memberOf module:jsdoc/tagdictionary.tagDefinitions
|
||||
*/
|
||||
new TagDefinition('category', {
|
||||
isExported: true
|
||||
});
|
||||
|
||||
/** Syntax: @deprecated <text>
|
||||
@property {TagDefinition} deprecated
|
||||
@memberOf module:jsdoc/tagdictionary.tagDefinitions
|
||||
*/
|
||||
new TagDefinition('deprecated', {
|
||||
isExported: true
|
||||
});
|
||||
})();
|
||||
17
test/samples/jsdoc_quotename.js
Normal file
17
test/samples/jsdoc_quotename.js
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
@namespace
|
||||
@name chat."#channel"
|
||||
*/
|
||||
chat["#channel"] = {};
|
||||
|
||||
|
||||
/**
|
||||
@property
|
||||
@type {boolean}
|
||||
@name chat."#channel".open
|
||||
*/
|
||||
chat["#channel"].open = true;
|
||||
|
||||
/**
|
||||
@event chat."#channel"."op:announce-motd"
|
||||
*/
|
||||
@ -38,7 +38,7 @@ function Shape(){
|
||||
/**
|
||||
* This is an inner method, just used here as an example
|
||||
* @private
|
||||
* @method Shape-addReference
|
||||
* @method Shape~addReference
|
||||
* @since version 0.5
|
||||
* @author Sue Smart
|
||||
*/
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
it('should have an `name` property set to the last entire quoted segment of that string', function() {
|
||||
var doclet = doclets[2].toObject();
|
||||
expect(doclet).to(have_property, 'name');
|
||||
expect(doclet.name).to(eql, 'and.don\'t.forget#Po!');
|
||||
expect(doclet.name).to(eql, '"and.don\'t.forget#Po!"');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user