diff options
| author | Misko Hevery | 2011-01-31 11:55:44 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2011-02-01 09:58:37 -0800 | 
| commit | ed768ebc53ef6746ca83d81892c22d2e9c3afeef (patch) | |
| tree | 2835e5ab21d4700724c28d8bf1178ea13e622eae /docs/src/ngdoc.js | |
| parent | 9fd3dfe49d283c136e29bf60c0da6d4fe2aaed3d (diff) | |
| download | angular.js-ed768ebc53ef6746ca83d81892c22d2e9c3afeef.tar.bz2 | |
Developer guide documentation
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index e01d9ccf..a3a037cd 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -114,7 +114,7 @@ Doc.prototype = {              description: markdown(text.replace(match[0], match[2]))            };          } else if(atName == 'description') { -          text.replace(/<doc:scenario>([\s\S]*)<\/doc:scenario>/mi, +          text.replace(/<doc:scenario>([\s\S]*?)<\/doc:scenario>/gmi,                function(_, scenario){                  self.scenarios.push(scenario);                }); @@ -154,7 +154,7 @@ Doc.prototype = {          throw new Error("Don't know how to format @ngdoc: " + self.ngdoc);        }).call(self, dom); -      dom.example(self.exampleDescription, self.example, self.scenario); +      dom.example(self.exampleDescription, self.example, self.scenarios[0]);      });      return dom.toString(); @@ -438,6 +438,8 @@ Doc.prototype = {  //////////////////////////////////////////////////////////  function markdown (text) { +  var IS_URL = /^(https?:\/\/|ftps?:\/\/|mailto:)/; +  var IS_ANGULAR = /^angular\./;    if (!text) return text;    var parts = text.split(/(<pre>[\s\S]*?<\/pre>|<doc:example>[\s\S]*?<\/doc:example>)/),        match; @@ -462,10 +464,10 @@ function markdown (text) {        text = text.replace(/<angular\/>/gm, '<tt><angular/></tt>');        text = text.replace(/{@link ([^\s}]+)((\s|\n)+(.+?))?\s*}/gm,          function(_all, url, _2, _3, title){ -          return '<a href="#!' + url + '">' -            + (url.match(/^angular\./) ? '<code>' : '') +          return '<a href="' + (url.match(IS_URL) ? '' : '#!') + url + '">' +            + (url.match(IS_ANGULAR) ? '<code>' : '')              + (title || url) -            + (url.match(/^angular\./) ? '</code>' : '') +            + (url.match(IS_ANGULAR) ? '</code>' : '')              + '</a>';          });        text = new Showdown.converter().makeHtml(text); | 
