mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix documentation for ie
This commit is contained in:
parent
5a3c9190dc
commit
55ce859998
3 changed files with 10 additions and 10 deletions
|
|
@ -86,7 +86,7 @@ describe('ngdoc', function(){
|
|||
'<doc:source>\n<>\n</doc:source></doc:example> after');
|
||||
doc.parse();
|
||||
expect(doc.description).toContain('<p>before </p><doc:example>' +
|
||||
'<doc:source>\n<>\n</doc:source></doc:example><p>after</p>');
|
||||
'<pre class="doc-source">\n<>\n</pre></doc:example><p>after</p>');
|
||||
});
|
||||
|
||||
it('should escape <doc:scenario> element', function(){
|
||||
|
|
@ -94,7 +94,7 @@ describe('ngdoc', function(){
|
|||
'<doc:scenario>\n<>\n</doc:scenario></doc:example> after');
|
||||
doc.parse();
|
||||
expect(doc.description).toContain('<p>before </p><doc:example>' +
|
||||
'<doc:scenario>\n<>\n</doc:scenario></doc:example><p>after</p>');
|
||||
'<pre class="doc-scenario">\n<>\n</pre></doc:example><p>after</p>');
|
||||
});
|
||||
|
||||
describe('sorting', function(){
|
||||
|
|
@ -364,8 +364,8 @@ describe('ngdoc', function(){
|
|||
' <doc:scenario><scenario></doc:scenario>\n' +
|
||||
'</doc:example>').parse();
|
||||
var html = doc.html();
|
||||
expect(html).toContain('<doc:source><escapeme></doc:source>');
|
||||
expect(html).toContain('<doc:scenario><scenario></doc:scenario>');
|
||||
expect(html).toContain('<pre class="doc-source"><escapeme></pre>');
|
||||
expect(html).toContain('<pre class="doc-scenario"><scenario></pre>');
|
||||
expect(doc.scenarios).toEqual(['<scenario>']);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -77,12 +77,12 @@ Doc.prototype = {
|
|||
} else if (text.match(/^<doc:example>/)) {
|
||||
text = text.replace(/(<doc:source>)([\s\S]*)(<\/doc:source>)/mi,
|
||||
function(_, before, content, after){
|
||||
return before + htmlEscape(content) + after;
|
||||
return '<pre class="doc-source">' + htmlEscape(content) + '</pre>';
|
||||
});
|
||||
text = text.replace(/(<doc:scenario>)([\s\S]*)(<\/doc:scenario>)/mi,
|
||||
function(_, before, content, after){
|
||||
self.scenarios.push(content);
|
||||
return before + htmlEscape(content) + after;
|
||||
return '<pre class="doc-scenario">' + htmlEscape(content) + '</pre>';
|
||||
});
|
||||
} else {
|
||||
text = text.replace(/<angular\/>/gm, '<tt><angular/></tt>');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue