aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2010-11-16 17:02:04 -0800
committerIgor Minar2010-11-18 02:34:52 -0800
commit71c2f24fc64e8d38089ac9476d05e01baf448879 (patch)
tree1313772c9b21cd7f5fc5ba7f9ac25265ca35fd16
parentfc78738cc6e1e9c7a3b381348348b48fe1ce8fb4 (diff)
downloadangular.js-71c2f24fc64e8d38089ac9476d05e01baf448879.tar.bz2
remove extra toolbar directive and support multiple pre's in describe
-rw-r--r--docs/collect.js4
-rw-r--r--docs/spec/collectSpec.js14
2 files changed, 15 insertions, 3 deletions
diff --git a/docs/collect.js b/docs/collect.js
index 4665133d..30597862 100644
--- a/docs/collect.js
+++ b/docs/collect.js
@@ -142,12 +142,12 @@ function escapedHtmlTag(doc, name, value) {
function markdownTag(doc, name, value) {
doc[name] = markdown(value.replace(/^#/gm, '##')).
- replace(/\<pre\>/gmi, '<div ng:non-bindable><pre class="brush: js; html-script: true; toolbar: false;">').
+ replace(/\<pre\>/gmi, '<div ng:non-bindable><pre class="brush: js; html-script: true;">').
replace(/\<\/pre\>/gmi, '</pre></div>');
}
function markdown(text) {
- var parts = text.split(/(<pre>[\s\S]*<\/pre>)/);
+ var parts = text.split(/(<pre>[\s\S]*?<\/pre>)/);
parts.forEach(function(text, i){
if (!text.match(/^<pre>/)) {
text = text.replace(/<angular\/>/gm, '<tt>&lt;angular/&gt;</tt>');
diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js
index 6f82ec3d..4d398be3 100644
--- a/docs/spec/collectSpec.js
+++ b/docs/spec/collectSpec.js
@@ -185,7 +185,19 @@ describe('collect', function(){
describe('@description', function(){
it('should support pre blocks', function(){
TAG.description(doc, 'description', '<pre>abc</pre>');
- expect(doc.description).toEqual('<div ng:non-bindable><pre class="brush: js; html-script: true; toolbar: false;">abc</pre></div>');
+ expect(doc.description).
+ toBe('<div ng:non-bindable><pre class="brush: js; html-script: true;">abc</pre></div>');
+ });
+
+ it('should support multiple pre blocks', function() {
+ TAG.description(doc, 'description', 'foo \n<pre>abc</pre>\n#bah\nfoo \n<pre>cba</pre>');
+ expect(doc.description).
+ toBe('<p>foo </p>' +
+ '<div ng:non-bindable><pre class="brush: js; html-script: true;">abc</pre></div>' +
+ '<h2>bah</h2>\n\n' +
+ '<p>foo </p>' +
+ '<div ng:non-bindable><pre class="brush: js; html-script: true;">cba</pre></div>');
+
});
});