aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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>');
+
});
});