From 55ce859998ad1f34ae84175cbb322fd8ce498970 Mon Sep 17 00:00:00 2001
From: Misko Hevery
Date: Tue, 22 Feb 2011 14:48:53 -0800
Subject: fix documentation for ie
---
docs/spec/ngdocSpec.js | 8 ++++----
docs/src/ngdoc.js | 4 ++--
docs/src/templates/doc_widgets.js | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)
(limited to 'docs')
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index b4a301a7..9c1a49ac 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -86,7 +86,7 @@ describe('ngdoc', function(){
'\n<>\n after');
doc.parse();
expect(doc.description).toContain('
before
' +
- '\n<>\nafter
');
+ '\n<>\n
after
');
});
it('should escape element', function(){
@@ -94,7 +94,7 @@ describe('ngdoc', function(){
'\n<>\n after');
doc.parse();
expect(doc.description).toContain('before
' +
- '\n<>\nafter
');
+ '\n<>\n
after
');
});
describe('sorting', function(){
@@ -364,8 +364,8 @@ describe('ngdoc', function(){
' \n' +
'').parse();
var html = doc.html();
- expect(html).toContain('<escapeme>');
- expect(html).toContain('<scenario>');
+ expect(html).toContain('<escapeme>
');
+ expect(html).toContain('<scenario>
');
expect(doc.scenarios).toEqual(['']);
});
});
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 93d5c43e..2f59f044 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -77,12 +77,12 @@ Doc.prototype = {
} else if (text.match(/^/)) {
text = text.replace(/()([\s\S]*)(<\/doc:source>)/mi,
function(_, before, content, after){
- return before + htmlEscape(content) + after;
+ return '' + htmlEscape(content) + '
';
});
text = text.replace(/()([\s\S]*)(<\/doc:scenario>)/mi,
function(_, before, content, after){
self.scenarios.push(content);
- return before + htmlEscape(content) + after;
+ return '' + htmlEscape(content) + '
';
});
} else {
text = text.replace(//gm, '<angular/>');
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js
index e811ff0c..a21fc5e1 100644
--- a/docs/src/templates/doc_widgets.js
+++ b/docs/src/templates/doc_widgets.js
@@ -2,7 +2,7 @@
var angularJsUrl;
var scripts = document.getElementsByTagName("script");
- var angularJsRegex = /^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/
+ var angularJsRegex = /^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/;
for(var j = 0; j < scripts.length; j++) {
var src = scripts[j].src;
if (src && src.match(angularJsRegex)) {
@@ -25,9 +25,9 @@
this.descend(true); //compile the example code
element.hide();
- var example = element.find('doc\\:source').eq(0),
+ var example = element.find('pre.doc-source').eq(0),
exampleSrc = example.text(),
- scenario = element.find('doc\\:scenario').eq(0);
+ scenario = element.find('pre.doc-scenario').eq(0);
var code = indent(exampleSrc);
var tabHtml =
@@ -63,7 +63,7 @@
function indent(text) {
if (!text) return text;
- var lines = text.split(/\n/);
+ var lines = text.split(/[\n|\r]/);
var lineNo = [];
// remove any leading blank lines
while (lines[0].match(/^\s*$/)) lines.shift();
--
cgit v1.2.3